diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 6ceb127bc..19ef41309 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,25 +1,25 @@ lockVersion: 2.0.0 id: 38254260-287a-40b6-9ac5-c2fcb654c9cc management: - docChecksum: 324c5a112761a7f8c856fc76717396c2 - docVersion: 10.23.19 - speakeasyVersion: 1.718.0 - generationVersion: 2.824.1 - releaseVersion: 0.30.3 - configChecksum: 5b7dbbf176c95042258de51c448afa51 + docChecksum: e9c39bb0b4ed846e121feb7cf6c671c0 + docVersion: 10.23.21 + speakeasyVersion: 1.725.0 + generationVersion: 2.836.5 + releaseVersion: 0.30.4 + configChecksum: 970441b62c6d77251360db643df676ea repoURL: https://github.com/apideck-libraries/sdk-java.git published: true persistentEdits: - generation_id: 807a8f1f-2780-499a-878d-1efdb5494b3a - pristine_commit_hash: 1ef3ecbadc26d9e79f09ebf0a8c2bbf6ba0a0461 - pristine_tree_hash: 83ae3fec36dc7e27277a362c610fa5354fdd5abc + generation_id: a84b1323-8501-4017-ac22-a1a3a68b7862 + pristine_commit_hash: be04b27f81b66d53a54b0ddd4eb4863ac21bf63f + pristine_tree_hash: 23008c5a0dba53b6d5d94fd7390b43c86661932b features: java: acceptHeaders: 2.81.2 additionalDependencies: 0.1.0 additionalProperties: 0.0.1 constsAndDefaults: 0.1.2 - core: 3.55.10 + core: 3.55.14 deprecations: 2.81.2 downloadStreams: 0.1.1 errors: 1.0.0 @@ -32,7 +32,7 @@ features: groups: 2.81.3 inputOutputModels: 2.83.0 methodServerURLs: 2.82.1 - nameOverrides: 2.81.3 + nameOverrides: 2.81.5 nullables: 0.1.0 openEnums: 0.2.0 pagination: 1.0.1 @@ -90,6 +90,26 @@ trackedFiles: id: 3bb22780f8b7 last_write_checksum: sha1:5c9ee055c4e84e19327cbaa2d3d0c0568b73569e pristine_git_object: ecdbf6cbd33cbcc60299b4ba2c0c60e6fda0f418 + docs/models/components/AccountingEmployee.md: + id: 010e07eced1a + last_write_checksum: sha1:40bb113f66c7c331a12a09e756656063dd2300af + pristine_git_object: 2a3295d17add0a2351064da719f82fae4f6ad0ba + docs/models/components/AccountingEmployeeInput.md: + id: 9a96e5c78566 + last_write_checksum: sha1:8e9b6a5602335acda67d690ab113bd80de5e2866 + pristine_git_object: 2f0109c88f8ba6a3219306e545edccc552019700 + docs/models/components/AccountingEmployeeManager.md: + id: 33c2d1e4bffd + last_write_checksum: sha1:67a9ad54418112aab8e4c18d674cb10007495991 + pristine_git_object: add85ee97ad2bdd805c162e8ecc768d091a17b85 + docs/models/components/AccountingEmployeesFilter.md: + id: b41d5f0f4331 + last_write_checksum: sha1:f5301796f359d27b505e8343b6f2250ee9818f28 + pristine_git_object: 376cce42c1ee8c2f53fa64819930e18596f8cf34 + docs/models/components/AccountingEmployeesFilterStatus.md: + id: 52dcfd818b7f + last_write_checksum: sha1:59a3a648d7208c9086b4056a4d7c3ef39b5b5315 + pristine_git_object: a498983e5a453dc5784a4aac6e3a0886e3f13134 docs/models/components/AccountingLocation.md: id: 6e08bbd81540 last_write_checksum: sha1:51f6f352d89a38662dae0eb70dabe2411383d42f @@ -106,6 +126,10 @@ trackedFiles: id: 82320c53981e last_write_checksum: sha1:2ebd2d5abae28b9b35cb6279b89a86f77f3a0a9c pristine_git_object: d72d69ef41d8ca9eab5ad7771112a32a82c6d906 + docs/models/components/AccountingPeriod.md: + id: 48f9562d3c67 + last_write_checksum: sha1:4e08ecef84784a27acd68edab04744dd3a292ce6 + pristine_git_object: c5f6d6027be590d74149654df5efc863639aa1f9 docs/models/components/ActivitiesFilter.md: id: 30b8b4a69e94 last_write_checksum: sha1:965070e73de855acbc47ca593808c9aa92913b00 @@ -242,6 +266,10 @@ trackedFiles: id: 3cdc1c73279b last_write_checksum: sha1:9e4e2f698accd1d9108574628e75778032541fb6 pristine_git_object: 6f3b1699f754f49f5c825c891b98671ca49566b4 + docs/models/components/ApprovedBy.md: + id: 5c26ed95bdc5 + last_write_checksum: sha1:282933400ade752ff46ef1cb236acf917c7a6144 + pristine_git_object: 00efa97043e993f9bafeb4002edd837a1f3c72d8 docs/models/components/Assignee.md: id: cd62a31d7c93 last_write_checksum: sha1:af7be26726435b94d45a39104961af1bdb757f09 @@ -710,6 +738,10 @@ trackedFiles: id: 29a683192e67 last_write_checksum: sha1:fbcc2d1479c540adeabef2f21862cc967cd7c6a7 pristine_git_object: 3dde85eeecd5069919f143f58aa8b2e9781282ad + docs/models/components/CreateAccountingEmployeeResponse.md: + id: 9e465cbe0fd7 + last_write_checksum: sha1:fd52a310d077792d8500ef3707b0b7c3a896a413 + pristine_git_object: 0210cad84ca3e597115ab26871ecdf5d0aa7c851 docs/models/components/CreateAccountingLocationResponse.md: id: 11fabe8f2ab0 last_write_checksum: sha1:3793b06723e6c26bbadaf8b47d55e21c0069d276 @@ -818,6 +850,14 @@ trackedFiles: id: 0265a686885d last_write_checksum: sha1:ca26224d25da9ce97a2ffd7db058e996c201971b pristine_git_object: 117f9e1ef6cf8c01b71d05ed90b3e0003f86db95 + docs/models/components/CreateExpenseCategoryResponse.md: + id: 707d5e1338c2 + last_write_checksum: sha1:93b215dc3b11dd5edd9809957558c48551dba780 + pristine_git_object: e0fc32dcf7ce7a20764cc89942792f9e84c7583f + docs/models/components/CreateExpenseReportResponse.md: + id: 3664ded8d95b + last_write_checksum: sha1:45b4a26abd1548a0f26db67a8ddcaf3cf4190d82 + pristine_git_object: 7b4d6af510e998ff1f36a4c7d3eb12e306437a9a docs/models/components/CreateExpenseResponse.md: id: 84a9d15b256e last_write_checksum: sha1:b6a9011d5b7f846c5dae068404e211d03d5d5806 @@ -1122,6 +1162,10 @@ trackedFiles: id: 116025b4d8a0 last_write_checksum: sha1:052b9dd83b3e78dc13d9248666dc0805fe589d73 pristine_git_object: 65e25b5068952607b4f051bd271fd523aae78fea + docs/models/components/DeleteAccountingEmployeeResponse.md: + id: 2d75fd8b2938 + last_write_checksum: sha1:fbbf4d481b3430fa3c3bf61391e3bd1a5a5ada35 + pristine_git_object: aed8ff13863268687786e96a3ff6c7669eee585b docs/models/components/DeleteAccountingLocationResponse.md: id: 79e8ef82192d last_write_checksum: sha1:4cd3ce1807799a9f0eb765958d98e8f13f8db906 @@ -1214,6 +1258,14 @@ trackedFiles: id: c09552a9157f last_write_checksum: sha1:9ebbfd35e1f6b338229f168d3be6f050dea315c0 pristine_git_object: 1618a8af6697ed6617d63c1b7ee22d9d9c4f557f + docs/models/components/DeleteExpenseCategoryResponse.md: + id: e39547508d85 + last_write_checksum: sha1:71ac8123eb64633214e704844b2cba4fd7d3870b + pristine_git_object: ec739207f8b5f23ad5896250611a5f2b58f467ee + docs/models/components/DeleteExpenseReportResponse.md: + id: c16d0c563e83 + last_write_checksum: sha1:ed5b0a284fa4d31a7fa2a9e81fb9a326e6fa64b2 + pristine_git_object: 28b71379728c0c521ed559e117379ddecd1c6003 docs/models/components/DeleteExpenseResponse.md: id: f0c1698863b1 last_write_checksum: sha1:8cf7e86a0dffcd560a85da1db8e3ce39170ca813 @@ -1494,6 +1546,10 @@ trackedFiles: id: 6066b9835ea7 last_write_checksum: sha1:89374c75cbeb890fe52715f005a576ec9e354313 pristine_git_object: d0d2bd7a48a092f11b36d2bcf6583ad2920da66a + docs/models/components/EmployeeStatus.md: + id: 8d11011679f9 + last_write_checksum: sha1:4ecac7f44ec6f0b8af1e2229d7e9b547150b9cbb + pristine_git_object: 1b41574befceb464e4c617251c8f9cb0768abdd0 docs/models/components/EmployeesFilter.md: id: ce3df7f4eb50 last_write_checksum: sha1:0c6e9b8ac068aceae1f615cb257105392ebe6e43 @@ -1550,6 +1606,26 @@ trackedFiles: id: bc4a7f3cbdf8 last_write_checksum: sha1:c78b23ae702cb967074b795333b46bd0fffeb545 pristine_git_object: c0a7dbbd04340f966b088ff8f1d62e50ffa17ed7 + docs/models/components/ExpenseCategoriesFilter.md: + id: b20fa883b95f + last_write_checksum: sha1:b41a89aadc09398a36cd3cd86a473910149ae121 + pristine_git_object: 10c88708321270c5c8d79a24e45a73a64a66c95f + docs/models/components/ExpenseCategoriesFilterStatus.md: + id: 46b881d1ea8c + last_write_checksum: sha1:c539a95492194f64cd703a764624e7f66c011adb + pristine_git_object: 244159d018da332548e90079f356c774b306df97 + docs/models/components/ExpenseCategory.md: + id: b188b7b40775 + last_write_checksum: sha1:827ca061da8119bdd952d60991a4afd6958a40dc + pristine_git_object: 039131de706d79c340b5d25082353a33d1623162 + docs/models/components/ExpenseCategoryInput.md: + id: 35bef4e34959 + last_write_checksum: sha1:26f8671d8d50a4541b3605232bf7c3391bbd67e1 + pristine_git_object: 7444a5dd2a3dc22ebeaa02e158029f45662c8919 + docs/models/components/ExpenseCategoryStatus.md: + id: c56758e52cea + last_write_checksum: sha1:d17826fca8c26480ea26f548c8b0ef56484bee29 + pristine_git_object: fb30f72f6506164d358a9c7e78e4a047a9f4a863 docs/models/components/ExpenseInput.md: id: f0699569c2d2 last_write_checksum: sha1:bcebdc063ce9956b9d2bec615681593919b251e9 @@ -1566,6 +1642,42 @@ trackedFiles: id: 249d9d3b5065 last_write_checksum: sha1:317956776f7becd340588a851c75f34d86bb4fe5 pristine_git_object: bb856785bb29100dba91f98d96cdf1d2b2b25d66 + docs/models/components/ExpenseReport.md: + id: 91b5755d76ca + last_write_checksum: sha1:43d74c11187a291465c72820557837ad24966647 + pristine_git_object: 8b2f238c79498e5dc45f9ecc79c69eee164534d3 + docs/models/components/ExpenseReportEmployee.md: + id: 3167a3021434 + last_write_checksum: sha1:16bb79bfc8f5533165ae5d2e37cc34bb46c2c9be + pristine_git_object: eb4e288dfe93b5bafe83caa42c25c77a3695a63d + docs/models/components/ExpenseReportInput.md: + id: e6769f1fc3fe + last_write_checksum: sha1:4b60fbe596160e5cc55ab5c25231450d089450de + pristine_git_object: b26adbadb1ba407d3b0295fc5d9420016e840896 + docs/models/components/ExpenseReportLineItem.md: + id: d63076a2a79c + last_write_checksum: sha1:fe503553f4b29ed55662f3869475c2721884cefa + pristine_git_object: 5140f6dc36dff1eb812e05598d1bb6b65144cf27 + docs/models/components/ExpenseReportLineItemExpenseCategory.md: + id: ee913852e242 + last_write_checksum: sha1:10b060a51a43db98f2ce0f5e67008af1cab85631 + pristine_git_object: 432c22ea063387f681acebe3205cde63e4a5499f + docs/models/components/ExpenseReportLineItemInput.md: + id: 279485bf1841 + last_write_checksum: sha1:5b1e3015aa1d0878359e01150f7f11b1c6f34674 + pristine_git_object: f1a9d0d1dee4e7be3cfc7029c98768cf7743e648 + docs/models/components/ExpenseReportStatus.md: + id: a1a7d2821493 + last_write_checksum: sha1:9dab487faad1a438c2cfef1cfb89c338e5c7bdae + pristine_git_object: f037f080d0d3dc27c739d30203438eec77f40834 + docs/models/components/ExpenseReportsFilter.md: + id: 826ddf5ed017 + last_write_checksum: sha1:6215a8ae3bd536aa6ee411c8a7404f003a818d8a + pristine_git_object: 7074be8f067eac4457c4cacd619ede294c7ffeaf + docs/models/components/ExpenseReportsFilterStatus.md: + id: e632a008e5f6 + last_write_checksum: sha1:350b9dd658ebe4e37b7760c32ce9ae6853c54610 + pristine_git_object: 6a56b6169d07fe992921c9342606f95c56748425 docs/models/components/ExpenseStatus.md: id: 59c7ed984edc last_write_checksum: sha1:223efb60b06f4f5b95e2060358d301979daff1e9 @@ -1674,6 +1786,14 @@ trackedFiles: id: db60c1743fa7 last_write_checksum: sha1:0355a6a022ca9a8da60e5d48eea6ff3cd143262b pristine_git_object: caad8503efbf586789020df129e469a705cebbf5 + docs/models/components/GetAccountingEmployeeResponse.md: + id: 3408d2077be9 + last_write_checksum: sha1:27f060e7ab339a14704fed0064913464d7f8e3cb + pristine_git_object: e19b7539aea8625b1cc30a09091d636053ddd08c + docs/models/components/GetAccountingEmployeesResponse.md: + id: c18314ef4d37 + last_write_checksum: sha1:30d5dd4a064d7b7616690061ea39c4305af8f3da + pristine_git_object: cdfdcc911b31ad841d76f1cd727555c9fcdd9615 docs/models/components/GetAccountingLocationResponse.md: id: c93c418f9ed7 last_write_checksum: sha1:c9a345e480a30b239784b3a827c7932bc1eca787 @@ -1970,6 +2090,22 @@ trackedFiles: id: 69f12737df87 last_write_checksum: sha1:2ddb06b5b328541ce9a0e88cb5711a122efe041a pristine_git_object: a33a4d12ce097a708b3734c89d39848eda41d55d + docs/models/components/GetExpenseCategoriesResponse.md: + id: 91a1de45b3c1 + last_write_checksum: sha1:63306bd7500739bee220677df5f9992ecdc9bda0 + pristine_git_object: 90fdc26fdab4c72797b7697cb8bf9e8811638353 + docs/models/components/GetExpenseCategoryResponse.md: + id: c4a6df7bed14 + last_write_checksum: sha1:5a8010edc10a49e5896f21ba8b5707cd86d1aac8 + pristine_git_object: 3dd3dc0a82c55131f060c6f65c8ec86297deb559 + docs/models/components/GetExpenseReportResponse.md: + id: 45ca0b58071c + last_write_checksum: sha1:843fe09d8b67629b94ea80830ee9e559df7253ad + pristine_git_object: a986ed7f94f62c733da82c61b4beb93a53a3c1e7 + docs/models/components/GetExpenseReportsResponse.md: + id: ec117ff486d3 + last_write_checksum: sha1:450c595aeb77c4476a8964482146ef23ee6146c3 + pristine_git_object: 9d9ed54903828b24127ac4e36e32299faf0b9e22 docs/models/components/GetExpenseResponse.md: id: 3b9a01b312fb last_write_checksum: sha1:b73733a18d35489267b4a62cd31a4d7c8231d8ce @@ -2530,6 +2666,14 @@ trackedFiles: id: 449a7123e7ad last_write_checksum: sha1:01bfbb53237d20c0bbadb626f6158972fd9be24b pristine_git_object: 723d27b78599e60f0317c34f11d0386a0c8b0ce8 + docs/models/components/LinkedSubsidiary.md: + id: 5e5117bdf305 + last_write_checksum: sha1:0add6c34839833fc63a128ce9a821a0172163b7d + pristine_git_object: 0074f8b731704f260888adefce915239e636b4f5 + docs/models/components/LinkedSubsidiaryInput.md: + id: f128e9edd2b7 + last_write_checksum: sha1:8307faf0f04b4b4f4f51a5773ea78727deb125d8 + pristine_git_object: cdf5d0543ca5faa8af3d18908a3feab66a00525c docs/models/components/LinkedSupplier.md: id: 53c5f1ace544 last_write_checksum: sha1:e7b7947478c4432a2a03de3d62b09ebc0cfd4af8 @@ -3298,6 +3442,10 @@ trackedFiles: id: e7c809c97896 last_write_checksum: sha1:bf013ccc77eb51e7b6dc5c9f23023052cde99cc0 pristine_git_object: 389747cbf455ae24eabe213daade9ccbaa7cefe0 + docs/models/components/UpdateAccountingEmployeeResponse.md: + id: 667ad3d38871 + last_write_checksum: sha1:978b8d62a084de28b3815e7a8b0ed38836376238 + pristine_git_object: fcb9149354cec83785da2eaa82c60577bf95a068 docs/models/components/UpdateAccountingLocationResponse.md: id: 138edf795799 last_write_checksum: sha1:8e8bccb273fa4991f39f2b4c200f8f08a8b0d788 @@ -3402,6 +3550,14 @@ trackedFiles: id: 2662efdb5751 last_write_checksum: sha1:b3062e7adee6ee7834083f54bd47cdb84c92edac pristine_git_object: 186b9ab62eed314f00b7152cf080472f8695b8a5 + docs/models/components/UpdateExpenseCategoryResponse.md: + id: a8127393ea3b + last_write_checksum: sha1:47e3dd686a8b03ecb7e9ff69daf0907b9de8330b + pristine_git_object: 580e1ed1a55e0e5dc2f0641b1519d3f42ff20da7 + docs/models/components/UpdateExpenseReportResponse.md: + id: ca4012c20b4e + last_write_checksum: sha1:c757fe2c944907a0df50b4bd3ad7333145dbccc7 + pristine_git_object: c24a20b49196f2a7e396e4a57d373564e35fb8d6 docs/models/components/UpdateExpenseResponse.md: id: e4618158748f last_write_checksum: sha1:71fa4c7832ebebecb2be2cbc18c5abb159479219 @@ -4086,6 +4242,126 @@ trackedFiles: id: 2888fe33c502 last_write_checksum: sha1:e444c38cb831ad68717a3a4e372d16efdb37070a pristine_git_object: a79d819e49395c978f794d8d8d14bfb1faff4a84 + docs/models/operations/AccountingEmployeesAddRequest.md: + id: 089dece41432 + last_write_checksum: sha1:2430cc41e1ef62248369a2b34fe971d3208db3e6 + pristine_git_object: c127db47bd4c28a860596ac96f512a1dcfea7f9b + docs/models/operations/AccountingEmployeesAddResponse.md: + id: 8302182c5c33 + last_write_checksum: sha1:7c3b9f2fbb42a47fcff797c499a5f6ceab856e6e + pristine_git_object: 2d7b8c531856ad1726df3d1aed84c93636bf313c + docs/models/operations/AccountingEmployeesAllRequest.md: + id: afa3e9e0aecb + last_write_checksum: sha1:61c9e359f20eed836f7abc2c9b23df172c859a36 + pristine_git_object: 54096d4a115c58b50b21ae1a090328ad0cea1d6f + docs/models/operations/AccountingEmployeesAllResponse.md: + id: 8c0f7d2795e2 + last_write_checksum: sha1:53511af11b7c4ab27b41699ae3a7c6eea9cb1a8f + pristine_git_object: bce24c58980c780205d557926f63bd25e2ac65a8 + docs/models/operations/AccountingEmployeesDeleteRequest.md: + id: 2aa88522cd50 + last_write_checksum: sha1:73e22dff8caa1b07cdd1eccdc58080371ce7598b + pristine_git_object: abb05fe0cdb6af5c436809df397e9d970f121c08 + docs/models/operations/AccountingEmployeesDeleteResponse.md: + id: a78cadeda94b + last_write_checksum: sha1:9b86a34c7cf2c4c3acf9a8a6b2a72182bf8cb1ff + pristine_git_object: 2cbe009a431258b2c6d47a38305190e237090b2e + docs/models/operations/AccountingEmployeesOneRequest.md: + id: bf350c4d89ea + last_write_checksum: sha1:16dffae360e1df6ca034352203c010a74ef7f978 + pristine_git_object: 1405f7d608597fb2acb1c7f50d5f80519009b121 + docs/models/operations/AccountingEmployeesOneResponse.md: + id: a3f131f6e39e + last_write_checksum: sha1:2ded73222bd0aff9db12cf1d27dfca1e62d3d4b5 + pristine_git_object: 7c046168e461339ae907be568b90aea52cef69ce + docs/models/operations/AccountingEmployeesUpdateRequest.md: + id: 7cd26d1c8c27 + last_write_checksum: sha1:35bc7baebc8c91743b69a562d1ed4db016b13a21 + pristine_git_object: 8269c0fdab3df842f0da14f9e324dd7c6a65f81f + docs/models/operations/AccountingEmployeesUpdateResponse.md: + id: ab2eb2814168 + last_write_checksum: sha1:abe26997f7a27ebfd63af91c1858cc416794346b + pristine_git_object: dd3b15d85e64079885403c45211203e757a6a115 + docs/models/operations/AccountingExpenseCategoriesAddRequest.md: + id: 0371efe8a0bc + last_write_checksum: sha1:a9fd0949a6200bb24a036cff342c2e6ee5a4cfeb + pristine_git_object: b6fb9355c05f206a8938f8153e71f784003a674c + docs/models/operations/AccountingExpenseCategoriesAddResponse.md: + id: 53027b94f4b7 + last_write_checksum: sha1:9346268882e210054c9a1a8751ab3bc17b222ba5 + pristine_git_object: 06fa93d63d10d74718b0efec0d2fcf64a0cf5d75 + docs/models/operations/AccountingExpenseCategoriesAllRequest.md: + id: 22b4ad0a7fe5 + last_write_checksum: sha1:49d9472f069d0ee2693a72d407835c1d36219285 + pristine_git_object: 175511e4922ef9f9aebc5eefd82b592f887de90b + docs/models/operations/AccountingExpenseCategoriesAllResponse.md: + id: 636fec650eaa + last_write_checksum: sha1:fea1d2c0f5b92e91dce4732ca701ff15b664894d + pristine_git_object: 437ce369a84aef4e82a092e50ff633163487c360 + docs/models/operations/AccountingExpenseCategoriesDeleteRequest.md: + id: 30c0cce2c64b + last_write_checksum: sha1:311884049f3519dafbd7a3784c0fad0df39fcdfa + pristine_git_object: be8345ed2213749fd34e5affad85093cadff8ce9 + docs/models/operations/AccountingExpenseCategoriesDeleteResponse.md: + id: e8934936c079 + last_write_checksum: sha1:30abbded7a6150a7725e3a6d003ecdf5276e2e6a + pristine_git_object: d9f243bdc04829726e808b7c18760989ff5e111e + docs/models/operations/AccountingExpenseCategoriesOneRequest.md: + id: 4c67992f845b + last_write_checksum: sha1:f0377927aafc66a2ce2a3362d8dc2c5b573f1948 + pristine_git_object: d442e44331bac308d11cde3ec4438aa3f89550ee + docs/models/operations/AccountingExpenseCategoriesOneResponse.md: + id: b961363b9ef4 + last_write_checksum: sha1:73b09ed0fcfa18d8fff1462ef48976c05c4a3706 + pristine_git_object: 817c55f6d5af885deb4754d9ec19b919f70e977f + docs/models/operations/AccountingExpenseCategoriesUpdateRequest.md: + id: 5797c9625113 + last_write_checksum: sha1:5d1d6b4e8417d7e2fd379251d5a95fb6661ccbed + pristine_git_object: 6333d5a1aee17ff45cea075013feca451c5431d7 + docs/models/operations/AccountingExpenseCategoriesUpdateResponse.md: + id: c68f6c642459 + last_write_checksum: sha1:44d3588202a9d4b1709cb317355502830b96b412 + pristine_git_object: 838e950cef58047e0e8c9cec8f08752c0ef9eb7c + docs/models/operations/AccountingExpenseReportsAddRequest.md: + id: d54c9a9089a3 + last_write_checksum: sha1:065c9f518c779ccbd087094346c5bcdbb665fb8d + pristine_git_object: d78d97db6d9a73567e355a9c7568cd447f9a1fee + docs/models/operations/AccountingExpenseReportsAddResponse.md: + id: 35d0f6e048c9 + last_write_checksum: sha1:09407f67f9f3116b1789a070aa5cd9b53faba1ac + pristine_git_object: 9417a2c6ec9943dc2ff442cd01a5c73d0e58a9bb + docs/models/operations/AccountingExpenseReportsAllRequest.md: + id: 266755053fc7 + last_write_checksum: sha1:dacacd64b6d7cbe0f1a6a5c0d353b98f6f2dc9a2 + pristine_git_object: 27d1fbba5ce23df3895688af7e72ae5e9679ddd4 + docs/models/operations/AccountingExpenseReportsAllResponse.md: + id: c7ed3db750e3 + last_write_checksum: sha1:049b56f8982571323d3f4270cf2aa8e7e352e08d + pristine_git_object: b939048f0e628d553f1b1ec14574a4133842ffe3 + docs/models/operations/AccountingExpenseReportsDeleteRequest.md: + id: 05572ca340a7 + last_write_checksum: sha1:c8e2c615b65831e70e918c297dad6d8d9b1a44c7 + pristine_git_object: bd1df3391f811c3fed69255650e7e04655dba684 + docs/models/operations/AccountingExpenseReportsDeleteResponse.md: + id: 6bcd5ec45664 + last_write_checksum: sha1:f5ea99882bef4129806cda40904d28b785cd5145 + pristine_git_object: b8ebf95357c8ed989e8f920c78ed706190351056 + docs/models/operations/AccountingExpenseReportsOneRequest.md: + id: 9d22c8202f51 + last_write_checksum: sha1:7a8beec51144f019dbb8e032dbf6c12caead2de8 + pristine_git_object: d62652aafcaa2e0e3033a60c26e899512000dc59 + docs/models/operations/AccountingExpenseReportsOneResponse.md: + id: e78413377dbb + last_write_checksum: sha1:1f9d94e5035f39a652e96618df4fa13a4e01a01d + pristine_git_object: 2f0cbc59b18a134e8f473daf2d0c7371272c85ac + docs/models/operations/AccountingExpenseReportsUpdateRequest.md: + id: 0c0b43c11e04 + last_write_checksum: sha1:c38fc08399b277edc1f2ff6a0f01e27de504ea67 + pristine_git_object: 270a6095713556bff465055ffe493954e8b7fe84 + docs/models/operations/AccountingExpenseReportsUpdateResponse.md: + id: 68c6fe8e75eb + last_write_checksum: sha1:e34a80491d7a63c311f725866057bf16b3666cf2 + pristine_git_object: e2fa9937702e685150eff9735e07500cf77dd27a docs/models/operations/AccountingExpensesAddRequest.md: id: 694f82701084 last_write_checksum: sha1:bcf38d8808fa746901c994870f1d4e6aeb8cff90 @@ -6218,6 +6494,10 @@ trackedFiles: id: aba46004a169 last_write_checksum: sha1:476f332052abe22ce271d71b16c8ef049a58a305 pristine_git_object: d85d6087f863ac1439d8fe8d9564dc30e2aec890 + docs/sdks/apideckemployees/README.md: + id: b99b038bb0b0 + last_write_checksum: sha1:8a6a4a92bc6e0108aad066de343f586359dd34f9 + pristine_git_object: b65b2b66bbb0f9c31da910536b6eb905a47177a9 docs/sdks/apiresourcecoverage/README.md: id: b21a4fa7d12d last_write_checksum: sha1:b42a92c4bd760b5ffa248c9cc8276437f0d862a9 @@ -6388,12 +6668,20 @@ trackedFiles: pristine_git_object: a4768d3c5d6b1276642dc45316d2496319704115 docs/sdks/employees/README.md: id: 3adbd327ce9d - last_write_checksum: sha1:8a6a4a92bc6e0108aad066de343f586359dd34f9 - pristine_git_object: b65b2b66bbb0f9c31da910536b6eb905a47177a9 + last_write_checksum: sha1:139b3404d3aa45dec3508097288b60cbeefdb0bd + pristine_git_object: d091134e674b0551eb99cf1e1b2f02e80b846ce7 docs/sdks/employeeschedules/README.md: id: 9855d4282404 last_write_checksum: sha1:63d66f0edd70e779e1ad65d1dcbbe87c77d8d8fa pristine_git_object: 0a891cf926731766b5d8739015898ec687f955ca + docs/sdks/expensecategories/README.md: + id: b3b488c373df + last_write_checksum: sha1:2b53f6fa4ea5dd7446a3909ed47b0b5f07d1c17d + pristine_git_object: ca0b95506fb9c21dad425ec35a6b104417e6a84f + docs/sdks/expensereports/README.md: + id: bd1c9bec7278 + last_write_checksum: sha1:092d7cccb5394693e70c2f4f7352d26cce9a0444 + pristine_git_object: f804f75a7e1bc815399a459afe4b2b9c16fd3508 docs/sdks/expenses/README.md: id: 5692d1aab79d last_write_checksum: sha1:c5fba2868fedadfb83e784706cae7e0f4ccb489d @@ -6544,8 +6832,8 @@ trackedFiles: pristine_git_object: c755c6aa377f358344e761e9cc3e7b67bc1fb479 gradle.properties: id: 2afbb999f001 - last_write_checksum: sha1:6f4eb56b2fc844426c90cd8e6a28f4c1fcaba090 - pristine_git_object: 9add4631552f458984e2f4d20e7629ec5534935e + last_write_checksum: sha1:fe80af5bc4b45812c04398a444908709f111b417 + pristine_git_object: 831218560e8340c61b0a136ca26fdaedac25988a gradle/wrapper/gradle-wrapper.jar: id: ec27dae6e852 last_write_checksum: sha1:f725fb1467084142d74fd7cd8eab691ab3442611 @@ -6600,8 +6888,8 @@ trackedFiles: pristine_git_object: 79e98e1b46457fb90adda7459c9269f8acbc0e88 src/main/java/com/apideck/unify/Accounting.java: id: a26e2542bb82 - last_write_checksum: sha1:d56f0cfc497dedecb743e4867e03792a919b5143 - pristine_git_object: 9dae508a7d0c16e31de8a16464d1ba3f168eca27 + last_write_checksum: sha1:46de7d169704e4401d7c1d21750ccd2584bcabfc + pristine_git_object: f0b19e4103c0a2ab61cb1e4ced27b6a49ff3ae07 src/main/java/com/apideck/unify/Activities.java: id: 6620d356ac86 last_write_checksum: sha1:494b108c87669aeb2b0535c6a18c4f58c7b655cb @@ -6638,6 +6926,10 @@ trackedFiles: id: 321a434fb463 last_write_checksum: sha1:72a8c54ff1fcb4904d9e50a6229997a917f6078c pristine_git_object: 2e0b5afaec20062141bc934a1d08b694f7017ce3 + src/main/java/com/apideck/unify/ApideckEmployees.java: + id: 413e2a62f2ed + last_write_checksum: sha1:77f9040b93fa35d821682536bf01768954f8323b + pristine_git_object: ef23980d9f9c41ee234bb56152e3c291d864d164 src/main/java/com/apideck/unify/Apis.java: id: d2202ca1ce8f last_write_checksum: sha1:fad5eddfffb91643df6e6e87fbf2af3f01afe7f0 @@ -6652,8 +6944,8 @@ trackedFiles: pristine_git_object: db25bd77eff772cdb55e346375ad00e9bd73690c src/main/java/com/apideck/unify/AsyncAccounting.java: id: 8d268d98214f - last_write_checksum: sha1:b0151ce7fc96519fa3c84a9dcf0f40a4086c799e - pristine_git_object: 8e99698d7d58b0bcbdb627756ab23306fe89a7e3 + last_write_checksum: sha1:198cb4f2f06a0fe8b850c1f1e51246e8678dc2c1 + pristine_git_object: d78f94dabde7a0579f9fd8e1462535b33b1b8653 src/main/java/com/apideck/unify/AsyncActivities.java: id: 6e509d02b899 last_write_checksum: sha1:37dd284ae02b0f4d26a66a2f65d8c1b6c1b83a05 @@ -6690,6 +6982,10 @@ trackedFiles: id: 28b99beada5a last_write_checksum: sha1:842a76e3631de9e4f8750fd3d8f17f8e20c631e1 pristine_git_object: ccd739fd67d644081f798ff60a83eeb6838bf457 + src/main/java/com/apideck/unify/AsyncApideckEmployees.java: + id: 07f5f0b8d700 + last_write_checksum: sha1:3d92684bd9804525936dc4c8e69d90e7ad1a8b18 + pristine_git_object: bc40f5e1ffd22a78206056c70186b96472e3cbec src/main/java/com/apideck/unify/AsyncApis.java: id: c7335222a255 last_write_checksum: sha1:476d70cffdbb50960b5be55f7042d443ee95cf62 @@ -6872,8 +7168,16 @@ trackedFiles: pristine_git_object: 2ba61672e0eb2d69af10ba80a8638f307943c4c4 src/main/java/com/apideck/unify/AsyncEmployees.java: id: d1d863c18a84 - last_write_checksum: sha1:3c65f7a125d89ee8ce997ddb8d4033923c8982aa - pristine_git_object: 2199e303fd0afb9b8f9583b21995136fd2194057 + last_write_checksum: sha1:f4b0c3a92896a3ea825289abcfdf36f5b0e79948 + pristine_git_object: f890f3c82f44bc0302f2747dc435fc8cb9fc47ad + src/main/java/com/apideck/unify/AsyncExpenseCategories.java: + id: 10fd29c8a9e9 + last_write_checksum: sha1:c1c7fd826995efa72d7eab92737e077e65c2e61e + pristine_git_object: ee6ded575a1a6220cd56b206905cb096c94692b1 + src/main/java/com/apideck/unify/AsyncExpenseReports.java: + id: d83ca8621d9e + last_write_checksum: sha1:bb9443a7ffb397c715f4283d2d02e161187dc94e + pristine_git_object: 5107c8d965fecc04e813a8f29b7608766bf1973d src/main/java/com/apideck/unify/AsyncExpenses.java: id: 4b48fa1d10f9 last_write_checksum: sha1:7ef251b003a5b3c945e49a3c334f2ffe01885129 @@ -6892,8 +7196,8 @@ trackedFiles: pristine_git_object: 79f6d2a5a2ae86189f242faaa4ccb0f31245e681 src/main/java/com/apideck/unify/AsyncHris.java: id: ef095c8d9c53 - last_write_checksum: sha1:bae3f6902e7fe1bdadf07f2e2ca903e1d5d33e61 - pristine_git_object: ffa214a59fd2aab9916e4d4a5ddb634f623543dc + last_write_checksum: sha1:db42c1fb00d96e61ad5ef904eda44ad69f5da334 + pristine_git_object: 8d091c04425b23e867cad048528f05e6ee8cbbe0 src/main/java/com/apideck/unify/AsyncInvoiceItems.java: id: ca5f923075b9 last_write_checksum: sha1:462fe17d63256b9427155eb04f634493120fcd0a @@ -7212,8 +7516,16 @@ trackedFiles: pristine_git_object: b7d6bf51eff87aeb12a25a39c384de229aaa7390 src/main/java/com/apideck/unify/Employees.java: id: 81c563f37207 - last_write_checksum: sha1:1b376e1af524b0896f704d6c0b5db3b871c9edb8 - pristine_git_object: d0432866f72b3e1f96d67c3b60ffb95985fcb941 + last_write_checksum: sha1:8264c34f56e4bcdf50679effed91c6dbbc44a82b + pristine_git_object: 0bd4221e8707c7662ffd3d3c9656ed18ea45def8 + src/main/java/com/apideck/unify/ExpenseCategories.java: + id: 3d49eb0c5057 + last_write_checksum: sha1:351fbc7520187f827481f394be836bda1042afbb + pristine_git_object: f9c9cdfc3e7fb9fb9ca01759dc81e12d0abbb45b + src/main/java/com/apideck/unify/ExpenseReports.java: + id: d38fc790ade2 + last_write_checksum: sha1:e83a4e32d1918cc650d4887a1c3a14d15ca07c46 + pristine_git_object: 84827b266a76770617ff3ed480a721fcc1452281 src/main/java/com/apideck/unify/Expenses.java: id: 8026db715836 last_write_checksum: sha1:116eab2cea835472049de612b4125d7be93ba08f @@ -7232,8 +7544,8 @@ trackedFiles: pristine_git_object: 06299d7e6427d8fa4b5d6f64867631b6864f8eb4 src/main/java/com/apideck/unify/Hris.java: id: 91d811d0daaa - last_write_checksum: sha1:2758beddfb9e36902a9e1728ad1e3ed589ef6bf9 - pristine_git_object: 6f8f5fa3d69ecc94e2504830004036f92c28eb6f + last_write_checksum: sha1:e3876dd564165357705ae41ac204891e50abae7c + pristine_git_object: 8373ccc8cdec0d267eee4e478ac0b2995648e1e6 src/main/java/com/apideck/unify/InvoiceItems.java: id: 3d5caed0ff3f last_write_checksum: sha1:2ff4c46eff2493f5940f9fd102eb7f2d89c67cb7 @@ -7324,8 +7636,8 @@ trackedFiles: pristine_git_object: f19fbaf1b4f5fe0ee68b6b2ccf4ce38637bae104 src/main/java/com/apideck/unify/SDKConfiguration.java: id: a2b330a87142 - last_write_checksum: sha1:970692dd5729475ae97afede498cad5b1d1917b5 - pristine_git_object: 1453c8f682caefec640910633e67b074dcbc2391 + last_write_checksum: sha1:3eb37e669a2b50661fa2a873013861f051d65845 + pristine_git_object: 0a63d8043bee604193ac28bf953060eb0e8ac391 src/main/java/com/apideck/unify/SecuritySource.java: id: e4566c6c806b last_write_checksum: sha1:101bf1a9f5cf4e8c37abb4540147276eebb2bab0 @@ -7426,6 +7738,26 @@ trackedFiles: id: 8522cbedd83f last_write_checksum: sha1:0adc5df278083ac77dfe3cc938ce2e090d575220 pristine_git_object: 1f0b264a1c048ed52b683a98dcaf0d38f8c1bdb1 + src/main/java/com/apideck/unify/models/components/AccountingEmployee.java: + id: 7f65237cde07 + last_write_checksum: sha1:898c544f957800f1db9b15dee7e08ac367daa8c6 + pristine_git_object: 1913295fa8cc0a96d62c5f03c5f809e4dfab6ba0 + src/main/java/com/apideck/unify/models/components/AccountingEmployeeInput.java: + id: 45b8e2d11911 + last_write_checksum: sha1:e694fc9a2db856d9eb5fca63fc70e544cfad81b4 + pristine_git_object: 31f1314178ff6e452b04c629850796824a51fd27 + src/main/java/com/apideck/unify/models/components/AccountingEmployeeManager.java: + id: 1ae90149575e + last_write_checksum: sha1:8cdb207553d4cc887ac7fd3bd9ed5685791f168f + pristine_git_object: c2a59c561bf7520db11f47cad9744dcb764d1a77 + src/main/java/com/apideck/unify/models/components/AccountingEmployeesFilter.java: + id: a2a180f732e2 + last_write_checksum: sha1:39bdea3a5c1ac8ef1c042c22b630dbed228a90d5 + pristine_git_object: f24a93b35c2b2e07f2f1a29892277d612afbf23e + src/main/java/com/apideck/unify/models/components/AccountingEmployeesFilterStatus.java: + id: 8760b33591bb + last_write_checksum: sha1:1e763e0653e764b72c11c0ad362e5a52182f1b2e + pristine_git_object: ea9c21a845a7672c86a23e4baf4924da03c9f313 src/main/java/com/apideck/unify/models/components/AccountingLocation.java: id: e171d32e8a79 last_write_checksum: sha1:6d3073bdcb3034fd4cf5cd17b8ee4dd6e69285f5 @@ -7442,6 +7774,10 @@ trackedFiles: id: d540327bd2a1 last_write_checksum: sha1:1841ccafd0fb6dba462ab1474da0997838f355ff pristine_git_object: 95bd8c9a91cf0892d49bf1b7dc8dc1cd501d0c0e + src/main/java/com/apideck/unify/models/components/AccountingPeriod.java: + id: 42ff17c149c0 + last_write_checksum: sha1:0ee4ae37b4173fd0115ee988ef9bcf6b65f4fe2a + pristine_git_object: e2fe408745764003061eee72f3168f5d635ee491 src/main/java/com/apideck/unify/models/components/ActivitiesFilter.java: id: 689ef66174e0 last_write_checksum: sha1:fa4b19336758e67bc5ed5a3d9ac47149a80b1f45 @@ -7578,6 +7914,10 @@ trackedFiles: id: 2d8ae662034c last_write_checksum: sha1:83c22509aa9e41f13fff6626a6342b08a0b669f9 pristine_git_object: 66e035b0f7f198c99e8da730d84bb7c7af9074e8 + src/main/java/com/apideck/unify/models/components/ApprovedBy.java: + id: dae8ff6971fa + last_write_checksum: sha1:8082a2e82918faaa845bbe88a2e844d6b0b5b922 + pristine_git_object: f190cafe841e1265226590710deae7233dfa9209 src/main/java/com/apideck/unify/models/components/Assignee.java: id: 76ea53d17290 last_write_checksum: sha1:9a9115dc1b62e137f42f7830e2bdacbb05ca4a3a @@ -8046,6 +8386,10 @@ trackedFiles: id: e022f32d27df last_write_checksum: sha1:a32adc670a4b64c8d60a7c1483232796bca00897 pristine_git_object: 0f321862c0c061b43ade46fe98f0fd2c252fccfc + src/main/java/com/apideck/unify/models/components/CreateAccountingEmployeeResponse.java: + id: f80089d77916 + last_write_checksum: sha1:998671908bd6d0cc3c89950d6ca2c26e378a7adf + pristine_git_object: fe9ce41a707003b37be7f1bc0f79e1933727b627 src/main/java/com/apideck/unify/models/components/CreateAccountingLocationResponse.java: id: 088a009b0ff6 last_write_checksum: sha1:7037337e01952969c6f44662321ea4a4ea5d6ab1 @@ -8154,6 +8498,14 @@ trackedFiles: id: 134896a7c699 last_write_checksum: sha1:e966090ce74c71643b042ed80fa1b18b9425919e pristine_git_object: 97958ccaf33b1fe803fb61a0c7ca6b1745a2fe7d + src/main/java/com/apideck/unify/models/components/CreateExpenseCategoryResponse.java: + id: 68cd31af1a9e + last_write_checksum: sha1:d8da21c7664c51d62af4b101d8dca41d9224c212 + pristine_git_object: 595cc3e6f7b407bc6a96493795ff4ad5390fed52 + src/main/java/com/apideck/unify/models/components/CreateExpenseReportResponse.java: + id: 16a475602489 + last_write_checksum: sha1:5bbd7c865c7f72dc6fb9a71ddff354b6c8dc3a20 + pristine_git_object: e0e380c6057db50de6e5d6fef17228578b267c60 src/main/java/com/apideck/unify/models/components/CreateExpenseResponse.java: id: 97ed12387e6b last_write_checksum: sha1:e4627c018b50d6fc48119a32e6d7d1e6b94a31df @@ -8458,6 +8810,10 @@ trackedFiles: id: e2f7b439dd50 last_write_checksum: sha1:0f7cba53f97ffb95094decfb53ade78ef24bd19d pristine_git_object: 093de48ecaf13afe0e74b8b35166db88b4401be0 + src/main/java/com/apideck/unify/models/components/DeleteAccountingEmployeeResponse.java: + id: 1da891bc09ee + last_write_checksum: sha1:c75ce68f6280a5157897e5b445d4bf660783a2a5 + pristine_git_object: c79629770ccbc7f29281560e32240779a7423d5b src/main/java/com/apideck/unify/models/components/DeleteAccountingLocationResponse.java: id: 59bd528de329 last_write_checksum: sha1:8f1f87d7f395e6853847f5771f1f580bef2edd76 @@ -8550,6 +8906,14 @@ trackedFiles: id: a83e1ca2e3ad last_write_checksum: sha1:34099fdc689ee2861b83b4667186abac16d06deb pristine_git_object: c489e3548feb4c9c2fc86b78e5bd964603668f79 + src/main/java/com/apideck/unify/models/components/DeleteExpenseCategoryResponse.java: + id: 00f50a44f73c + last_write_checksum: sha1:f50e3b82c2947f7722b8902828fd5a02645f45ce + pristine_git_object: a3d211aa946865126b621262ef6c0841a55c332b + src/main/java/com/apideck/unify/models/components/DeleteExpenseReportResponse.java: + id: 3a14e1f78f24 + last_write_checksum: sha1:4aea29c33f73d5a27a9935f3661730de47b977e4 + pristine_git_object: cfbe127c40b7100ae7886481efacf829110f19ef src/main/java/com/apideck/unify/models/components/DeleteExpenseResponse.java: id: 78d1316faf7e last_write_checksum: sha1:00c53ab86fe683cbfd12f4d472abfcb76bd3dc66 @@ -8830,6 +9194,10 @@ trackedFiles: id: 3a76ff804523 last_write_checksum: sha1:c7ff60ef80d9222dd83f329e1fac06a1a5bf71b4 pristine_git_object: 58a70d60393b473d3f301d1f3fd5c79400005e45 + src/main/java/com/apideck/unify/models/components/EmployeeStatus.java: + id: 4dbfbe529880 + last_write_checksum: sha1:1fd6db0cf17e57b73c68d18b8c3696b4509dfe73 + pristine_git_object: fad01ba227e63977c28f3301c28b053ee76a71d6 src/main/java/com/apideck/unify/models/components/EmployeesFilter.java: id: 02810106f303 last_write_checksum: sha1:ecf971c2990c6dda76080991385f1519326634cd @@ -8886,6 +9254,26 @@ trackedFiles: id: 4022deda663b last_write_checksum: sha1:81bcf19a857a9374d439528f7dd5d79d669359ea pristine_git_object: b534b72406d259c9cc5724708d89f977951d421a + src/main/java/com/apideck/unify/models/components/ExpenseCategoriesFilter.java: + id: a54819ecf1ed + last_write_checksum: sha1:87923ca70b6d9ed0a9a9fb0b60d4ecc7170fb1b4 + pristine_git_object: e7cf66be89323ca97ed3860587a74bb9fce384df + src/main/java/com/apideck/unify/models/components/ExpenseCategoriesFilterStatus.java: + id: 68b548e7bc40 + last_write_checksum: sha1:5f4de9abdd4111463a982b1607f549cbc932afe9 + pristine_git_object: 4fb635216cae7659e580bad120fce9879d5020bc + src/main/java/com/apideck/unify/models/components/ExpenseCategory.java: + id: c88f05e4fb68 + last_write_checksum: sha1:3d7a69c59147fa9a4395b4380ae1808bf58c9fa4 + pristine_git_object: b3e65e14592f59f08253b3a0f0a4f73aee923746 + src/main/java/com/apideck/unify/models/components/ExpenseCategoryInput.java: + id: fb130987f32a + last_write_checksum: sha1:0f0847eb06c8a37955bc55a5c26b913ecde2a853 + pristine_git_object: cd40a1dfb9a72e43bdeee045f139a104e91710a8 + src/main/java/com/apideck/unify/models/components/ExpenseCategoryStatus.java: + id: 4ef0a2659bad + last_write_checksum: sha1:296cde4e512f6b6cc6dab9ec9f0a6a7c1f6f84d5 + pristine_git_object: df5de48132229c47af85339817f834e0eec1bd0a src/main/java/com/apideck/unify/models/components/ExpenseInput.java: id: 3981ac315d80 last_write_checksum: sha1:f579a150a00c4788cde031e8f3568b1fa80abdcf @@ -8902,6 +9290,42 @@ trackedFiles: id: 17e44f32713e last_write_checksum: sha1:dcdb5ac9e90d17c84933bbfaabc5f4004f29a328 pristine_git_object: f26f20b44f1f54de4f5b31327218f7f9c3c8f9a1 + src/main/java/com/apideck/unify/models/components/ExpenseReport.java: + id: 9e9a3cfe908d + last_write_checksum: sha1:d98be1e86d3ae50fa63074554226a229606a02e7 + pristine_git_object: 43017e8f45575f6f25ae55b310a247bdf4639e3e + src/main/java/com/apideck/unify/models/components/ExpenseReportEmployee.java: + id: d4178cafa946 + last_write_checksum: sha1:3ce224e68b8f973d0ed84494ca48e6c5620ab1f8 + pristine_git_object: 81b76dcf5d73f89cbe26ff640add4d5900d45d15 + src/main/java/com/apideck/unify/models/components/ExpenseReportInput.java: + id: 497221990faa + last_write_checksum: sha1:b320207aa7473bbbab07a5efbae3ccd96738fc02 + pristine_git_object: d8144b0d36a7b7ccdc6033e8575d6f447c7cc56c + src/main/java/com/apideck/unify/models/components/ExpenseReportLineItem.java: + id: 540e3089dcbc + last_write_checksum: sha1:707c8e504d6e830c40a9226e7f0ff7a78f044c6c + pristine_git_object: 1647676b71852351e9ab6be4f3f9a45bd799f72d + src/main/java/com/apideck/unify/models/components/ExpenseReportLineItemExpenseCategory.java: + id: 38b11faa5f10 + last_write_checksum: sha1:8db58275b935e33ceef37f5fc201d045f31c75a6 + pristine_git_object: 93206b8ec6eceb545ff84d98dea5e4a4a60a23ff + src/main/java/com/apideck/unify/models/components/ExpenseReportLineItemInput.java: + id: 0fe32331bbdb + last_write_checksum: sha1:c1689916f36dcc55f045056964297bff70836eba + pristine_git_object: 78322ef4638a80c53504da0351ce0f001424af71 + src/main/java/com/apideck/unify/models/components/ExpenseReportStatus.java: + id: 80662c4e9578 + last_write_checksum: sha1:3f94e0edb5e9504c1383153fc131461e53ee3369 + pristine_git_object: 2fcbc308a453093f4d573d8793e871320a92d418 + src/main/java/com/apideck/unify/models/components/ExpenseReportsFilter.java: + id: 2dff48a4295d + last_write_checksum: sha1:52a4ea742bf2220758e4353777947c9fe91c4071 + pristine_git_object: 9d4dfd8b9e459de9aad1bb5c5bdb4fca0dc7df46 + src/main/java/com/apideck/unify/models/components/ExpenseReportsFilterStatus.java: + id: c23eb871bd3c + last_write_checksum: sha1:ec37155e9d6f4d89a3768e6f855e54e1267d2487 + pristine_git_object: 1ca93628de55abf9d1cc85785f19e7c96ca8840e src/main/java/com/apideck/unify/models/components/ExpenseStatus.java: id: 7b53b387205b last_write_checksum: sha1:782fbc530a5a59ec203dcdcfe9477bfdd8540b09 @@ -9014,6 +9438,14 @@ trackedFiles: id: 107134f79c93 last_write_checksum: sha1:ae977cd1d20255a3e0da7aa2ea2680b9c20c4ac0 pristine_git_object: f13fbbd49032cf2e2e684754292dad375896bc64 + src/main/java/com/apideck/unify/models/components/GetAccountingEmployeeResponse.java: + id: 91596dd36663 + last_write_checksum: sha1:7f9520347e0a7944025140ebf134d689b19bf1a3 + pristine_git_object: a132b619061ba658cc1e39bb2bcfaf198781c604 + src/main/java/com/apideck/unify/models/components/GetAccountingEmployeesResponse.java: + id: ea21e00a2da1 + last_write_checksum: sha1:358e786f22e12158bfb756faf25cc91c820caf6f + pristine_git_object: 2b43e49524ab3d435fc7d84ea9537555ee408194 src/main/java/com/apideck/unify/models/components/GetAccountingLocationResponse.java: id: 591b3164958c last_write_checksum: sha1:98f6d9ca3355c90cc53478430e692cafc5e56836 @@ -9310,6 +9742,22 @@ trackedFiles: id: 30a9403c414b last_write_checksum: sha1:c1cf9da7ea671c35b881fb1af49aff3afb554d57 pristine_git_object: 203d883726d3e51063aeda48c82d2b203db714fd + src/main/java/com/apideck/unify/models/components/GetExpenseCategoriesResponse.java: + id: 6e21c6f2acc0 + last_write_checksum: sha1:9491cc36a5631f113e1bdf65d48552b552e93ee9 + pristine_git_object: e6e5a37209c18bd993960da09446db90fc86c18d + src/main/java/com/apideck/unify/models/components/GetExpenseCategoryResponse.java: + id: b5163d6b044c + last_write_checksum: sha1:5fe92904017e3680bfb7b5af9007d5e1088ecf55 + pristine_git_object: 4048b81c017d74ca3a1ab088c45f2c62efc3d274 + src/main/java/com/apideck/unify/models/components/GetExpenseReportResponse.java: + id: 04d5a7640cd8 + last_write_checksum: sha1:3aea6fb5ba7f1f47591b009aea48059fc0cbc723 + pristine_git_object: de372597ae14924f74cd3a4078e9f20f4ad54420 + src/main/java/com/apideck/unify/models/components/GetExpenseReportsResponse.java: + id: f8d2328e31bf + last_write_checksum: sha1:973b8937facf500e26ff0e7e9c51846be808fabd + pristine_git_object: c6e17bfbd4b5cfef903e80e2055df60026c55591 src/main/java/com/apideck/unify/models/components/GetExpenseResponse.java: id: 129e1f1aaaad last_write_checksum: sha1:73e3e79e2c140d2a2181d4f355529d1b88fe0b21 @@ -9870,6 +10318,14 @@ trackedFiles: id: 0d3a188f0b6b last_write_checksum: sha1:f1f1f6a90f68359b658be420edd13b47758413c1 pristine_git_object: a14bfd94d9c2bca3e961ba718549065ee79fbae7 + src/main/java/com/apideck/unify/models/components/LinkedSubsidiary.java: + id: 616b9f255fbd + last_write_checksum: sha1:da2b0cdbe73bf10c1731e2ebaadf161e43ca3e40 + pristine_git_object: 85f5a88e2743309d3c3eb1c820944d40f4494d80 + src/main/java/com/apideck/unify/models/components/LinkedSubsidiaryInput.java: + id: 885ecf07910d + last_write_checksum: sha1:5cb16e8efe6b0efc617f9a88d078da776b4c9979 + pristine_git_object: bb33c2e9fea6738af88bbe66d919621312abb9d8 src/main/java/com/apideck/unify/models/components/LinkedSupplier.java: id: ca4c78d2d548 last_write_checksum: sha1:1f59f11ed9570e45979a12d0fdab5a3820e40934 @@ -10642,6 +11098,10 @@ trackedFiles: id: 7dcd83f47d22 last_write_checksum: sha1:01b80a6213b785bbeb4f0fb145b809b5e6f82e6c pristine_git_object: 14307d57d5124fcc7948f5b1fa8de685f73dbaf0 + src/main/java/com/apideck/unify/models/components/UpdateAccountingEmployeeResponse.java: + id: 8f3d898dc350 + last_write_checksum: sha1:e7df518a9f709ff2ddc4f9153a6c5dcf77295d14 + pristine_git_object: 29fb6728f60700b635cf8be807c0cd58a590e6c2 src/main/java/com/apideck/unify/models/components/UpdateAccountingLocationResponse.java: id: 252a31f37c48 last_write_checksum: sha1:55885e4b7d2885c9b48a3790eb76fa9ba8eb41f7 @@ -10746,6 +11206,14 @@ trackedFiles: id: 8b044038b9bd last_write_checksum: sha1:813bc5438e64b6a365f31a7485f0000ff90a072f pristine_git_object: 9e6b8f890c696893e8a5eac367559ecb6150a576 + src/main/java/com/apideck/unify/models/components/UpdateExpenseCategoryResponse.java: + id: 6d3102e06bad + last_write_checksum: sha1:9ea5ba2a6288804875ce580d0b070aa2a454ce49 + pristine_git_object: 7bec6a1508c49c388843b756ea8a5438799c5f73 + src/main/java/com/apideck/unify/models/components/UpdateExpenseReportResponse.java: + id: f5f3a73bcbe9 + last_write_checksum: sha1:21ea14fa94669ca96a0e6898252833ecd8628832 + pristine_git_object: 32f566d1c1e708d22d587c3c6ffe564a9e8e19a4 src/main/java/com/apideck/unify/models/components/UpdateExpenseResponse.java: id: 61e6a71e2697 last_write_checksum: sha1:2a626bbd13b95fbf559bcb49ff17d5923da97538 @@ -11242,6 +11710,66 @@ trackedFiles: id: 94b1799604ef last_write_checksum: sha1:88f130f777acef968450f81d248ed9ec534c1e71 pristine_git_object: ccd51add2689545107b38a965482458d21bef45a + src/main/java/com/apideck/unify/models/operations//async/AccountingEmployeesAddRequestBuilder.java: + id: d00c772d46ac + last_write_checksum: sha1:64e43d798525b416f4474f03cfd077aa461400d3 + pristine_git_object: 14fcf40c430d8f130248e6c7daa51a3e68192f23 + src/main/java/com/apideck/unify/models/operations//async/AccountingEmployeesAllRequestBuilder.java: + id: 429ca9551937 + last_write_checksum: sha1:cd8e06b1d2c24b5e81c09af76665db0cea94794d + pristine_git_object: f58360e7c0cc18a5c8620e94f308a4564d44cb0b + src/main/java/com/apideck/unify/models/operations//async/AccountingEmployeesDeleteRequestBuilder.java: + id: c62f6a76b52b + last_write_checksum: sha1:bdee1084a1b542317a08d97d0d2b9ee3c24ed659 + pristine_git_object: 9ad503173cd1eeb0c9ccc0f9a9a5c6c17d227bf3 + src/main/java/com/apideck/unify/models/operations//async/AccountingEmployeesOneRequestBuilder.java: + id: 109d52638f05 + last_write_checksum: sha1:81fa20d5c1987bb3498c38f44c79a6c5cb4c785b + pristine_git_object: 78356bafddbc40c1a2c8ae90a24d9382c0b9863b + src/main/java/com/apideck/unify/models/operations//async/AccountingEmployeesUpdateRequestBuilder.java: + id: 19c614b151ac + last_write_checksum: sha1:3a01186d419ebf434bc5e5a2925e484d74f5d950 + pristine_git_object: a59d8a97ddc7835f20a81af8fc34f9cfa2de48a5 + src/main/java/com/apideck/unify/models/operations//async/AccountingExpenseCategoriesAddRequestBuilder.java: + id: f7a5f6d79c59 + last_write_checksum: sha1:8aa0670ccd0517ded642e2a2a691a50cef2a7704 + pristine_git_object: eaadd01dbbce126ee88220b6441d4e8b5b5adeb2 + src/main/java/com/apideck/unify/models/operations//async/AccountingExpenseCategoriesAllRequestBuilder.java: + id: 80094b77b7e8 + last_write_checksum: sha1:ec55aba19d08f610892c019445e36d25545ce957 + pristine_git_object: 138d49ec47750c299b46d313c4c310f84f17e75e + src/main/java/com/apideck/unify/models/operations//async/AccountingExpenseCategoriesDeleteRequestBuilder.java: + id: baad830f2098 + last_write_checksum: sha1:327240f5ae535c52ffe231be8326445d7c627d69 + pristine_git_object: ac6ee5ea1eb968acba60d66d7249d3fdd7b25aea + src/main/java/com/apideck/unify/models/operations//async/AccountingExpenseCategoriesOneRequestBuilder.java: + id: fec85ca08418 + last_write_checksum: sha1:d93496fb60427b1beb76e27bb8ab95a26efd23b2 + pristine_git_object: 6ee935b04a8a601d2456eac84492d7ec4b19ba68 + src/main/java/com/apideck/unify/models/operations//async/AccountingExpenseCategoriesUpdateRequestBuilder.java: + id: aad5789c6e32 + last_write_checksum: sha1:4b82ec52abe460c5633048172865d38ba5d8e10f + pristine_git_object: bc65f3d874f20ba70ba357af9a482ea7e68b0dcf + src/main/java/com/apideck/unify/models/operations//async/AccountingExpenseReportsAddRequestBuilder.java: + id: c58d01d6043b + last_write_checksum: sha1:2c77d0d55e77f852ff7d9d20b4ba6de61ddaa99d + pristine_git_object: 8b4b35bf9adb347106671525d7a28e0a916e00dd + src/main/java/com/apideck/unify/models/operations//async/AccountingExpenseReportsAllRequestBuilder.java: + id: 402013a30a1f + last_write_checksum: sha1:22feb3966c575f7494e101aaaf5a3d0656626d6a + pristine_git_object: acbeb2c41a56f1470c0afec9fe7096030c0648f4 + src/main/java/com/apideck/unify/models/operations//async/AccountingExpenseReportsDeleteRequestBuilder.java: + id: 2052a3d18588 + last_write_checksum: sha1:732ae9f2a0bacbda2929c465f949c85ddf0afe36 + pristine_git_object: c01220019874809bc5d886d1f6d8f7097a7b98ad + src/main/java/com/apideck/unify/models/operations//async/AccountingExpenseReportsOneRequestBuilder.java: + id: cfacd51420f3 + last_write_checksum: sha1:90b370f05bac876395ea295cafb49722a9acbeb9 + pristine_git_object: 753debc828b4aeb7788122bd6df684acf07809bc + src/main/java/com/apideck/unify/models/operations//async/AccountingExpenseReportsUpdateRequestBuilder.java: + id: 194f277c53f8 + last_write_checksum: sha1:7c06d5b446ee60361525aa153f4c26611a1a61d7 + pristine_git_object: 062b562755922c49661ba588b87f1cd6a357a74e src/main/java/com/apideck/unify/models/operations//async/AccountingExpensesAddRequestBuilder.java: id: cc58a26d2361 last_write_checksum: sha1:754acb4d8fc0cba774637e04e67ee917dfe61fc3 @@ -12890,6 +13418,186 @@ trackedFiles: id: 19f6b16e321e last_write_checksum: sha1:aeb1651f299eadbe12fa64cde5ad39698ac04304 pristine_git_object: 8a0a9cf6ee43524b2f7213b071a5d73b42fc80eb + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAddRequest.java: + id: 176770f3a8cc + last_write_checksum: sha1:568d33a13925c74bf6dc98183be5014550a49266 + pristine_git_object: 5cfc26216d9eb0b86090f21be404b6ea0da0a8cf + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAddRequestBuilder.java: + id: 3d7c9cc8d800 + last_write_checksum: sha1:395a79fbf9eaf2a9234932017584f7ff57ee45af + pristine_git_object: e361c58c661d1e936856c5185a1b46e2f496e17a + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAddResponse.java: + id: 54b211acff35 + last_write_checksum: sha1:dd466a16b706aa41cdfa50ed2d21bf8ba5a5009f + pristine_git_object: a5234436a3c387fdba2d81dffa365c1bc620dbde + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAllRequest.java: + id: d7c5bd5bd301 + last_write_checksum: sha1:0642476c501cda453d71df876c99ea008080faed + pristine_git_object: 0aef1d127904aced39f04f5595592026691389d6 + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAllRequestBuilder.java: + id: 53ae941e69e7 + last_write_checksum: sha1:a7223e12d7f857d780481461f31da4742e38c7fa + pristine_git_object: c70c1608dc508fe5fc788b52b776a0f87a82d110 + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAllResponse.java: + id: 161a2b483352 + last_write_checksum: sha1:99045811cd70345ec9e88a18a168c679456682cf + pristine_git_object: f9c2e0433b489218d6c0d8c89417359ca542ebc2 + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesDeleteRequest.java: + id: d8d41026467f + last_write_checksum: sha1:69894fc27459aecc72566fcb012c65a2af39845f + pristine_git_object: d619ddf0c5bb35b8b5c42113ffb705cb6367200f + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesDeleteRequestBuilder.java: + id: b8c88cfc75b8 + last_write_checksum: sha1:b58c0c2a24456642ecd691a6db103e411ee191e3 + pristine_git_object: 7f1fe6904f92758715e695daad3df1e4767b6c54 + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesDeleteResponse.java: + id: 7471e911176c + last_write_checksum: sha1:614576b5905827a926f10ea2895e03938cf2a016 + pristine_git_object: 7c8e3f6faacf2c6e557e71487393596faf8f4539 + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesOneRequest.java: + id: d22a192df52b + last_write_checksum: sha1:f9b67045c5fde00a1d4a27d77e8771d2c999836e + pristine_git_object: be80203f647460636c6874d56cbda45e8128315a + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesOneRequestBuilder.java: + id: dc9c8fc21757 + last_write_checksum: sha1:18c72b91076f7d7f0516bf3fbf32866e39f9dde7 + pristine_git_object: ab2f513ef8685c173921edf464ec9f4d20a510c3 + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesOneResponse.java: + id: fac163bedfe6 + last_write_checksum: sha1:15ed6130779e37004460e29916b6b66d3aa1139d + pristine_git_object: b935384bbf414ec67cc65a5d6d8180af0a2a6fe1 + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesUpdateRequest.java: + id: 7daf8dc9495b + last_write_checksum: sha1:3b62a4d4e1da5febf6e0502c3ff7c6af82b26ceb + pristine_git_object: a07b97dec56ac1a2573049a548c693200674de01 + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesUpdateRequestBuilder.java: + id: 934210349f04 + last_write_checksum: sha1:5b56b2d6fad4e087674151acf542b35d714b5907 + pristine_git_object: 09bb81233bd180275296776244f3519274345956 + src/main/java/com/apideck/unify/models/operations/AccountingEmployeesUpdateResponse.java: + id: cd752566ea6d + last_write_checksum: sha1:852f4bb67432bb0d78dae26bdd2d83c19219a356 + pristine_git_object: 82e84f4e7849c87d22ec98d3e6ee1c261249af42 + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAddRequest.java: + id: fe752d3ad8be + last_write_checksum: sha1:673e40efd28edd383b3b37f3e46c6df01d80385e + pristine_git_object: ea2aa7dd7c687942d56b9a2cc88f27a49de6b879 + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAddRequestBuilder.java: + id: ecc7c824f2c4 + last_write_checksum: sha1:34f56d6e394a77704ae0ee38550ef2021f80af09 + pristine_git_object: caaf64ff5d85ac8dcabb2b8d9fb92e60701484a9 + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAddResponse.java: + id: 0a612b3dec78 + last_write_checksum: sha1:f104c17abce37bb9c29bfc779c4ae3b4684ff86f + pristine_git_object: ba447d7889edc14370ae42606ecb0a061bc3f784 + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAllRequest.java: + id: 51144bf77b57 + last_write_checksum: sha1:2a69a036aa6da79d596131e55bf8e4dfc1e9f623 + pristine_git_object: 452f8f69f6bcfc7db3ac61d824fe61020151d6ec + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAllRequestBuilder.java: + id: 12ae38544592 + last_write_checksum: sha1:172ac9c9e94e1985e197409bfd8baab0b81b7266 + pristine_git_object: fb51341e181fb3a3fcf61f8fe71b6d0084372e2d + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAllResponse.java: + id: 2962249f6c83 + last_write_checksum: sha1:570e22a18a357df1a64622ed78b92a2071a39fa3 + pristine_git_object: d12088074e6e96f1332cf75cf8ff4391d112677c + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesDeleteRequest.java: + id: 8158b166d658 + last_write_checksum: sha1:6c4221a3cb8b260cedf46043edfc930f773cf7ed + pristine_git_object: e428da31389d95df44685b9ca6e283af246b1bad + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesDeleteRequestBuilder.java: + id: 608282b396e6 + last_write_checksum: sha1:621bddc0212b8a3ee45ab8bd64852465b24c0bc8 + pristine_git_object: 0f1ce63a3e99d240685e76e2d139c1bb07fff63c + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesDeleteResponse.java: + id: a1092f459d61 + last_write_checksum: sha1:a011be2054a6cfa9e3782c3ad980853ef06ac196 + pristine_git_object: 946dbe1f3fd3d26e47909e3136e9dfbc69c1251c + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesOneRequest.java: + id: a9142b441736 + last_write_checksum: sha1:3e3ce9a4047cedf2fbbaa1772593f8431cc74557 + pristine_git_object: 28a9cabe3bcaabe3cda425a8d0a50988c897886b + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesOneRequestBuilder.java: + id: a3d588d714b0 + last_write_checksum: sha1:fb0fe38412cfac18c5b9d6a90c0da9e6c33b71cd + pristine_git_object: bf3efa4c3ab6a090378b6612a17b412c78065e9b + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesOneResponse.java: + id: 3ce2ff1c2f01 + last_write_checksum: sha1:6c5dce6bc2c6696dc883595f86350d48ba0ecc97 + pristine_git_object: b3c956dedbb15ba505180aa5b7418a2283508409 + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesUpdateRequest.java: + id: 5a76350c387e + last_write_checksum: sha1:31056582b1ee9c1c1cc96bfdc2822c56b72d9a15 + pristine_git_object: 9a3155ad23239443b0352d283f8ac7ce629bc18d + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesUpdateRequestBuilder.java: + id: 6fabe3dfc5fb + last_write_checksum: sha1:4f14a070c0b1acefc1407e71b9d81d6e027d4fda + pristine_git_object: 434b3f88d526d8fb94e6c8dfcd9332c44e82881a + src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesUpdateResponse.java: + id: 7647eb90fe71 + last_write_checksum: sha1:79b9c4f12eb697b6db527c5527f27f7f031f7ed7 + pristine_git_object: b39b27b7d4a4333eab17c8c97c032f4068ebe0ee + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAddRequest.java: + id: c15cef7120dd + last_write_checksum: sha1:97fe887058ec983778b3339afc2cd45f978d3abe + pristine_git_object: 9cf98593c4a2d398a1c703bf2fc31dc9198b406a + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAddRequestBuilder.java: + id: 3ff322a39f40 + last_write_checksum: sha1:5984622d2b526a6c51e9463656e91f691ac63bee + pristine_git_object: bce985406b4e28be5a4053e46217b6496837bc2b + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAddResponse.java: + id: 35675a32fe3c + last_write_checksum: sha1:120ea5e4d5de2e826062e46f789c3a7ac92495e5 + pristine_git_object: 2ffa86cfc74689d0c1719bc011556ee06b061dca + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAllRequest.java: + id: f2f97af27100 + last_write_checksum: sha1:8f411462fd4a490e394f856f72c076efff94b141 + pristine_git_object: e526edc952f5e0d172767325871057fa91a66fd9 + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAllRequestBuilder.java: + id: 38ba4a171882 + last_write_checksum: sha1:27aa3d0a5d27aca40f50314aa5a926913228fdd7 + pristine_git_object: b04dd29080cd8b3e152abbc11229ed53ad92ad0e + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAllResponse.java: + id: 767e1f1bcb98 + last_write_checksum: sha1:8e61656ae77bc56e79ea8307889dfa7b2cc08991 + pristine_git_object: 0f6606add1e55bebaf351163555ce35da5957786 + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsDeleteRequest.java: + id: faa1e4bb1e8d + last_write_checksum: sha1:67869ced8c62a25cf1c7ab2b2dffb1241aa0d770 + pristine_git_object: 14187b8c5e296e18959d28a211e25da947c48b5f + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsDeleteRequestBuilder.java: + id: acae2b743dee + last_write_checksum: sha1:03ab655ccde9c26dfe04b14bddab53d2af1ed74b + pristine_git_object: efaa0cfbe9b632f45d9d00256861db2ab3d67280 + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsDeleteResponse.java: + id: 654715406bb2 + last_write_checksum: sha1:e45bc104d1f38fa10e3085a19203d392ae0a3192 + pristine_git_object: 00b2448c1124d6e5549b7c1cc03ccba5df173444 + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsOneRequest.java: + id: 06014629faa2 + last_write_checksum: sha1:7d6f922b605305db65666f86967f0f533e179572 + pristine_git_object: d25f79ed44ebd5f5643cff1f9d73c390897c9b0c + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsOneRequestBuilder.java: + id: c0c4fd7c4e55 + last_write_checksum: sha1:abb68bd98a05a2780f461cb299b3d8f6aa0c52ec + pristine_git_object: 00bbed617ba2b6b47d8bd22d1198db659975e218 + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsOneResponse.java: + id: 73064e32f825 + last_write_checksum: sha1:a49c8855ebae4fc952a7ec1c57c50a1f50005e2e + pristine_git_object: b963fc77bf11c5fd8adba990e5bb51c9819d1972 + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsUpdateRequest.java: + id: 3c4bce7af4e2 + last_write_checksum: sha1:57b26b5097fe676ee18f1e3899d4b1322d66c98f + pristine_git_object: 03034ba9abca15e476f8dec76e04d186833a5270 + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsUpdateRequestBuilder.java: + id: 4afa2e98a90c + last_write_checksum: sha1:2d867ae3620277f951083fd27947ea8c973d3d24 + pristine_git_object: 813f8164901fec7d23293358064d520ae366d1d6 + src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsUpdateResponse.java: + id: f8cf02a76d2d + last_write_checksum: sha1:60384812cc5c66120d6abfae468c9077b4a52971 + pristine_git_object: 51d2340fb71c74805593dc8c82de101f8cd4736d src/main/java/com/apideck/unify/models/operations/AccountingExpensesAddRequest.java: id: 22731fa92229 last_write_checksum: sha1:a98ade2f65015ee4a593ca035538baf042f358b6 @@ -16238,6 +16946,66 @@ trackedFiles: id: ab8b1e566e27 last_write_checksum: sha1:58fb9a98494f715e5b8b8dd1abd2d9563e290f63 pristine_git_object: 689ec447f33229cc3f26dc92c25ffe257109d676 + src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesAddResponse.java: + id: e01a4d9a1638 + last_write_checksum: sha1:b090f62cb7c99775e473bea7d513fe6d8c1f37d5 + pristine_git_object: c1a28c2871533fbd10c814f1a2705952632b1e1b + src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesAllResponse.java: + id: 29942d729b9f + last_write_checksum: sha1:db40535d7e711b51970d6a80e67fed68aeac0ea0 + pristine_git_object: 4c2bb9b0a52455c768c85622a254458dd20006ad + src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesDeleteResponse.java: + id: 376ca855861c + last_write_checksum: sha1:b6dfd6fec7a92ccaf1de17a6387ae5c8db33b699 + pristine_git_object: 30acf9fe1912d7d4ef24834cbb65d37cc4157fe3 + src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesOneResponse.java: + id: af890db3f5e5 + last_write_checksum: sha1:58cd287fcd758fa51607c21e50cf189d9234d438 + pristine_git_object: 16b4c457b672894ef94a50fa0ae9cce2b511da64 + src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesUpdateResponse.java: + id: d025cb42a16e + last_write_checksum: sha1:960f31a8d4b807e0d4935a6ecc18f9ec34bcfacd + pristine_git_object: 75ddad36a728812922b0f18bda149479f8c1aab5 + src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesAddResponse.java: + id: a9166a82d29c + last_write_checksum: sha1:1ca2d531127310422b783e8b3769007998fa5a26 + pristine_git_object: 85e6390869d5872f89973cc34e7797c8d73338ba + src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesAllResponse.java: + id: b9750a9107bc + last_write_checksum: sha1:f78ec7b3a8119eeacbaee60daba3d7166ec4d9fd + pristine_git_object: 8518028fb926c97cba5eec2fa4300bde1c5a2e3e + src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesDeleteResponse.java: + id: 512bf39eb115 + last_write_checksum: sha1:ae39ef6e07b05a7ea392847e234bcd284dae8c42 + pristine_git_object: 60a55aac7823078c34cb956ed27d1cf2cfa3cfec + src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesOneResponse.java: + id: 8cea354c44da + last_write_checksum: sha1:dc0bfa0a75109114de7005fd3920adc85181a70c + pristine_git_object: 984f2e33a7b0722a046646c3cb6cc37bf4c048c2 + src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesUpdateResponse.java: + id: 5f95454c7304 + last_write_checksum: sha1:befc1b30fc65dc2f3e2ff713ad965b6a63b3e008 + pristine_git_object: bbc5ba8da069573cb6a249372fd2581258f5c44b + src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsAddResponse.java: + id: 1a7236056578 + last_write_checksum: sha1:956d3ba4a6509ece5179e288ecf092f2d9977dfc + pristine_git_object: 10f9f656350b15fb23cd5d2390e9a2d723b3266f + src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsAllResponse.java: + id: 8a587b1db759 + last_write_checksum: sha1:cef7d9d2a16093b93f32e99c583688c45457e011 + pristine_git_object: 5e92cc85ae0766a775710a571f024a8dd718847b + src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsDeleteResponse.java: + id: ba328493418d + last_write_checksum: sha1:50def6769d25e8c439b999498b6b750f8b3a1d9b + pristine_git_object: 98a486def6f0816e6aaf4c826dd16e529372f7f1 + src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsOneResponse.java: + id: 48fc838971ea + last_write_checksum: sha1:8f7c7f91f58b88986513265f806c05a9a0a22694 + pristine_git_object: 382060c9797ac4e4d0c7c0cc9d916304830758b1 + src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsUpdateResponse.java: + id: 891e09da7f4e + last_write_checksum: sha1:6cec396f2312bff63ca75be18b35671f6f7f0c92 + pristine_git_object: e80ddaa4495184dd1f866aecccce4bfb7fc007fb src/main/java/com/apideck/unify/models/operations/async/AccountingExpensesAddResponse.java: id: 6b016588ec91 last_write_checksum: sha1:326224d78698378f72669b59214367da99c4de00 @@ -17478,6 +18246,66 @@ trackedFiles: id: 3201702b9ecb last_write_checksum: sha1:05373eccfa1c4ae7e9936b69ba4cbced205b2497 pristine_git_object: 71717842070bb6b40a67ed99ce12b7312bc6d7a5 + src/main/java/com/apideck/unify/operations/AccountingEmployeesAdd.java: + id: 21f3fab0d414 + last_write_checksum: sha1:3332dfe4be6798cb8665e90bd6039e70980f7b7e + pristine_git_object: 86dc878df26561d03e4bc5f61cae995f19f3ba0a + src/main/java/com/apideck/unify/operations/AccountingEmployeesAll.java: + id: 7ced8be67b66 + last_write_checksum: sha1:27b471d0b376f19902c2e7e09696625c9988f35e + pristine_git_object: 777fb6d6e0609a7041a51722df487e06917d12a6 + src/main/java/com/apideck/unify/operations/AccountingEmployeesDelete.java: + id: ec38e1a39596 + last_write_checksum: sha1:c1b6bd03a80bc7b516d40aa5e4457697696d6215 + pristine_git_object: bd69675d2a2692bc6fe5489ce51dcd3ad073a16e + src/main/java/com/apideck/unify/operations/AccountingEmployeesOne.java: + id: f0b5c53b6cc8 + last_write_checksum: sha1:ad4a0900a6fbc4d9654d484ea9bc9b75cd15df7f + pristine_git_object: 44ac022afa5f545fbc3a5fbcfc79cccbf4a05a4f + src/main/java/com/apideck/unify/operations/AccountingEmployeesUpdate.java: + id: 96afbc59b69a + last_write_checksum: sha1:f86eafc271b945509def9619c3bb9f375bdf6986 + pristine_git_object: aa69128a9af84843eeffb7781856f42faa6b3e75 + src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesAdd.java: + id: 879d97aee6d4 + last_write_checksum: sha1:0d39f13ac4d43a54ef31a3db05e068cf152ec07c + pristine_git_object: 826c1a5a5502775129cd5d78c5199f49ccdf19e4 + src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesAll.java: + id: 62d0c40cb7c1 + last_write_checksum: sha1:d6b85bf7350937a0a8c898cc589f9fd87e5f6543 + pristine_git_object: ecdd35367fae615a16d4b0c600023b82f09a8760 + src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesDelete.java: + id: 80522cd5151b + last_write_checksum: sha1:f50220ad1d394cdd993329e21bdd9d1024a29093 + pristine_git_object: 2d204cc2fe8f62afce4ea4b16f209603e2a318df + src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesOne.java: + id: c95cf2d1f672 + last_write_checksum: sha1:fe2157519d82453f7df91b8d260a2d28eea20d5d + pristine_git_object: 1114c8f77c0a8d25406cca90a49371cb8fe4c572 + src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesUpdate.java: + id: b5493be69ac8 + last_write_checksum: sha1:64fc645b06cf48a6895b78c9e5374677d36417c5 + pristine_git_object: 30815fc032cadf146c27343657651af621a5997b + src/main/java/com/apideck/unify/operations/AccountingExpenseReportsAdd.java: + id: 4205db943dd3 + last_write_checksum: sha1:3974e301dc43012b5565273a33e20f8374158754 + pristine_git_object: abc3ae0b202dd5ad691ca7eb92e31351aae018a3 + src/main/java/com/apideck/unify/operations/AccountingExpenseReportsAll.java: + id: 8245ffe3c236 + last_write_checksum: sha1:a476fb53cfd9d7ffe84851dea1cd4c03a609523f + pristine_git_object: c1fb7538968c3181e70f2957dd7d4c8d62937b73 + src/main/java/com/apideck/unify/operations/AccountingExpenseReportsDelete.java: + id: 04d9f5d41b00 + last_write_checksum: sha1:204c977128834a9981383d1058a2d7ce3e5582db + pristine_git_object: ae2217ab9dcee12cb78934954e2398acd0dd90bb + src/main/java/com/apideck/unify/operations/AccountingExpenseReportsOne.java: + id: a34f6894d4e0 + last_write_checksum: sha1:942c7afe0a9d7794de0944092a95b364fead62c5 + pristine_git_object: c521e6f3bcd2cae593b87ed2e65c0d84899e205c + src/main/java/com/apideck/unify/operations/AccountingExpenseReportsUpdate.java: + id: 920909cc7393 + last_write_checksum: sha1:9d5f2532a98a585c8afaa21952b1eef08e0f874d + pristine_git_object: b437539bd5fd7f0c032ffbbf03de68d028e52694 src/main/java/com/apideck/unify/operations/AccountingExpensesAdd.java: id: 41a9de38d50f last_write_checksum: sha1:d8905f2d22012602424d8c886cb564dfa5d4e8db @@ -34407,9 +35235,427 @@ examples: application/xml: "" text/html: "" text/plain: "" + accounting.employeesAll: + speakeasy-default-accounting-employees-all: + parameters: + query: + raw: false + limit: 20 + fields: "id,updated_at" + filter: {"updated_since": "2020-09-30T07:43:32.000Z", "status": "active"} + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "Employees", "operation": "all", "data": [], "meta": {"items_on_page": 50, "cursors": {"previous": "em9oby1jcm06OnBhZ2U6OjE=", "current": "em9oby1jcm06OnBhZ2U6OjI=", "next": "em9oby1jcm06OnBhZ2U6OjM="}}, "links": {"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D", "current": "https://unify.apideck.com/crm/companies", "next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.employeesAdd: + speakeasy-default-accounting-employees-add: + parameters: + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + requestBody: + application/json: {"display_id": "123456", "first_name": "John", "last_name": "Doe", "display_name": "John Doe", "emails": [{"id": "123", "email": "elon@musk.com", "type": "primary"}], "employee_number": "EMP-001", "job_title": "Senior Accountant", "status": "active", "is_contractor": false, "department": {"display_id": "123456", "name": "Acme Inc."}, "location": {"id": "123456", "display_id": "123456", "name": "New York Office"}, "manager": {"id": "12345", "name": "Jane Smith"}, "hire_date": "2020-01-15", "termination_date": "2025-12-31", "gender": "male", "birth_date": "1990-05-20", "subsidiary": {"display_id": "123456", "name": "Acme Inc."}, "tracking_categories": [{"id": "123456", "code": "100", "name": "New York", "parent_id": "123456", "parent_name": "New York"}], "currency": "USD", "notes": "Some notes about this employee", "addresses": [{"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "line5": "Attention: Finance Dept", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}], "phone_numbers": [{"id": "12345", "country_code": "1", "area_code": "323", "number": "111-111-1111", "extension": "105", "type": "primary"}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} + responses: + "201": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "Employees", "operation": "add", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.employeesOne: + speakeasy-default-accounting-employees-one: + parameters: + path: + id: "" + query: + raw: false + fields: "id,updated_at" + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "Employees", "operation": "one", "data": {"id": "12345", "downstream_id": "12345", "display_id": "123456", "first_name": "John", "last_name": "Doe", "display_name": "John Doe", "emails": [{"id": "123", "email": "elon@musk.com", "type": "primary"}], "employee_number": "EMP-001", "job_title": "Senior Accountant", "status": "active", "is_contractor": false, "department": {"id": "12345", "display_id": "123456", "name": "Acme Inc.", "downstream_id": "12345"}, "location": {"id": "123456", "display_id": "123456", "name": "New York Office", "downstream_id": "12345"}, "manager": {"id": "12345", "name": "Jane Smith"}, "hire_date": "2020-01-15", "termination_date": "2025-12-31", "gender": "male", "birth_date": "1990-05-20", "subsidiary": {"id": "12345", "display_id": "123456", "name": "Acme Inc."}, "tracking_categories": [{"id": "123456", "code": "100", "name": "New York", "parent_id": "123456", "parent_name": "New York"}], "currency": "USD", "notes": "Some notes about this employee", "addresses": [{"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "line5": "Attention: Finance Dept", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}], "phone_numbers": [{"id": "12345", "country_code": "1", "area_code": "323", "number": "111-111-1111", "extension": "105", "type": "primary"}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.employeesUpdate: + speakeasy-default-accounting-employees-update: + parameters: + path: + id: "" + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + requestBody: + application/json: {"display_id": "123456", "first_name": "John", "last_name": "Doe", "display_name": "John Doe", "emails": [{"id": "123", "email": "elon@musk.com", "type": "primary"}], "employee_number": "EMP-001", "job_title": "Senior Accountant", "status": "active", "is_contractor": false, "department": {"display_id": "123456", "name": "Acme Inc."}, "location": {"id": "123456", "display_id": "123456", "name": "New York Office"}, "manager": {"id": "12345", "name": "Jane Smith"}, "hire_date": "2020-01-15", "termination_date": "2025-12-31", "gender": "male", "birth_date": "1990-05-20", "subsidiary": {"display_id": "123456", "name": "Acme Inc."}, "tracking_categories": [{"id": "123456", "code": "100", "name": "New York", "parent_id": "123456", "parent_name": "New York"}], "currency": "USD", "notes": "Some notes about this employee", "addresses": [{"id": "123", "type": "primary", "string": "25 Spring Street, Blackburn, VIC 3130", "name": "HQ US", "line1": "Main street", "line2": "apt #", "line3": "Suite #", "line4": "delivery instructions", "line5": "Attention: Finance Dept", "street_number": "25", "city": "San Francisco", "state": "CA", "postal_code": "94104", "country": "US", "latitude": "40.759211", "longitude": "-73.984638", "county": "Santa Clara", "contact_name": "Elon Musk", "salutation": "Mr", "phone_number": "111-111-1111", "fax": "122-111-1111", "email": "elon@musk.com", "website": "https://elonmusk.com", "notes": "Address notes or delivery instructions.", "row_version": "1-12345"}], "phone_numbers": [{"id": "12345", "country_code": "1", "area_code": "323", "number": "111-111-1111", "extension": "105", "type": "primary"}], "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "Employees", "operation": "update", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.employeesDelete: + speakeasy-default-accounting-employees-delete: + parameters: + path: + id: "" + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "quickbooks", "resource": "Employees", "operation": "delete", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.expenseCategoriesAll: + speakeasy-default-accounting-expense-categories-all: + parameters: + query: + raw: false + limit: 20 + fields: "id,updated_at" + filter: {"updated_since": "2020-09-30T07:43:32.000Z", "status": "active"} + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "netsuite", "resource": "ExpenseCategories", "operation": "all", "data": [], "meta": {"items_on_page": 50, "cursors": {"previous": "em9oby1jcm06OnBhZ2U6OjE=", "current": "em9oby1jcm06OnBhZ2U6OjI=", "next": "em9oby1jcm06OnBhZ2U6OjM="}}, "links": {"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D", "current": "https://unify.apideck.com/crm/companies", "next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.expenseCategoriesAdd: + speakeasy-default-accounting-expense-categories-add: + parameters: + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + requestBody: + application/json: {"display_id": "123456", "name": "Travel", "code": "TRAVEL-001", "description": "Travel-related expenses including flights, hotels, and ground transportation.", "status": "active", "account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "offset_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "tax_rate": {"id": "123456", "code": "N-T", "rate": 10}, "rate_required": false, "default_rate": 0.67, "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} + responses: + "201": + application/json: {"status_code": 200, "status": "OK", "service": "netsuite", "resource": "ExpenseCategories", "operation": "add", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.expenseCategoriesOne: + speakeasy-default-accounting-expense-categories-one: + parameters: + path: + id: "" + query: + raw: false + fields: "id,updated_at" + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "netsuite", "resource": "ExpenseCategories", "operation": "one", "data": {"id": "12345", "display_id": "123456", "name": "Travel", "code": "TRAVEL-001", "description": "Travel-related expenses including flights, hotels, and ground transportation.", "status": "active", "account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "offset_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "tax_rate": {"id": "123456", "code": "N-T", "name": "GST on Purchases", "rate": 10}, "rate_required": false, "default_rate": 0.67, "row_version": "1-12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.expenseCategoriesUpdate: + speakeasy-default-accounting-expense-categories-update: + parameters: + path: + id: "" + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + requestBody: + application/json: {"display_id": "123456", "name": "Travel", "code": "TRAVEL-001", "description": "Travel-related expenses including flights, hotels, and ground transportation.", "status": "active", "account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "offset_account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "tax_rate": {"id": "123456", "code": "N-T", "rate": 10}, "rate_required": false, "default_rate": 0.67, "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "netsuite", "resource": "ExpenseCategories", "operation": "update", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.expenseCategoriesDelete: + speakeasy-default-accounting-expense-categories-delete: + parameters: + path: + id: "" + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "netsuite", "resource": "ExpenseCategories", "operation": "delete", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.expenseReportsAll: + speakeasy-default-accounting-expense-reports-all: + parameters: + query: + raw: false + limit: 20 + fields: "id,updated_at" + filter: {"updated_since": "2020-09-30T07:43:32.000Z", "status": "submitted"} + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "netsuite", "resource": "ExpenseReports", "operation": "all", "data": [{"id": "12345", "display_id": "123456", "number": "ER-001", "title": "Q1 Business Travel", "employee": {"id": "12345", "display_name": "John Doe"}, "status": "submitted", "transaction_date": "2021-05-01T12:00:00.000Z", "posting_date": "2024-06-01", "due_date": "2024-06-15", "currency": "USD", "currency_rate": 0.69, "sub_total": 250, "total_tax": 25, "total_amount": 1250.75, "reimbursable_amount": 1100, "memo": "Business travel expenses for Q1 client meetings", "department": {"id": "12345", "display_id": "123456", "name": "Acme Inc.", "downstream_id": "12345"}, "location": {"id": "123456", "display_id": "123456", "name": "New York Office", "downstream_id": "12345"}, "account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "accounting_period": {"id": "12345", "name": "Q1 2024"}, "line_items": [{"id": "12345", "expense_category": {"id": "12345", "name": "Travel"}, "account": null, "description": "Flight to New York", "quantity": 1, "unit_price": 27500.5, "amount": 275, "tax_rate": {"id": "123456", "code": "N-T", "name": "GST on Purchases", "rate": 10}, "tax_amount": 27.5, "total_amount": 302.5, "transaction_date": "2024-05-15", "billable": true, "reimbursable": true, "customer": {"id": "12345", "display_id": "CUST00101", "display_name": "Windsurf Shop", "company_name": "The boring company", "email": "boring@boring.com"}, "department": {"id": "12345", "display_id": "123456", "name": "Acme Inc.", "downstream_id": "12345"}, "location": {"id": "123456", "display_id": "123456", "name": "New York Office", "downstream_id": "12345"}, "tracking_categories": [{"id": "123456", "code": "100", "name": "New York", "parent_id": "123456", "parent_name": "New York"}], "receipt_url": "https://example.com/receipts/123.pdf", "currency": "USD"}], "subsidiary": {"id": "12345", "display_id": "123456", "name": "Acme Inc."}, "tracking_categories": [{"id": "123456", "code": "100", "name": "New York", "parent_id": "123456", "parent_name": "New York"}], "tax_inclusive": true, "approved_by": {"id": "12345", "display_name": "Jane Smith"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}], "meta": {"items_on_page": 50, "cursors": {"previous": "em9oby1jcm06OnBhZ2U6OjE=", "current": "em9oby1jcm06OnBhZ2U6OjI=", "next": "em9oby1jcm06OnBhZ2U6OjM="}}, "links": {"previous": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D", "current": "https://unify.apideck.com/crm/companies", "next": "https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.expenseReportsAdd: + speakeasy-default-accounting-expense-reports-add: + parameters: + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + requestBody: + application/json: {"display_id": "123456", "number": "ER-001", "title": "Q1 Business Travel", "employee": {"id": "12345", "display_name": "John Doe"}, "status": "submitted", "transaction_date": "2021-05-01T12:00:00.000Z", "posting_date": "2024-06-01", "due_date": "2024-06-15", "currency": "USD", "currency_rate": 0.69, "sub_total": 250, "total_tax": 25, "total_amount": 1250.75, "reimbursable_amount": 1100, "memo": "Business travel expenses for Q1 client meetings", "department": {"display_id": "123456", "name": "Acme Inc."}, "location": {"id": "123456", "display_id": "123456", "name": "New York Office"}, "account": null, "accounting_period": {"id": "12345", "name": "Q1 2024"}, "line_items": [], "subsidiary": {"display_id": "123456", "name": "Acme Inc."}, "tracking_categories": [{"id": "123456", "code": "100", "name": "New York", "parent_id": "123456", "parent_name": "New York"}], "tax_inclusive": true, "approved_by": {"id": "12345", "display_name": "Jane Smith"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} + responses: + "201": + application/json: {"status_code": 200, "status": "OK", "service": "netsuite", "resource": "ExpenseReports", "operation": "add", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.expenseReportsOne: + speakeasy-default-accounting-expense-reports-one: + parameters: + path: + id: "" + query: + raw: false + fields: "id,updated_at" + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "netsuite", "resource": "ExpenseReports", "operation": "one", "data": {"id": "12345", "display_id": "123456", "number": "ER-001", "title": "Q1 Business Travel", "employee": {"id": "12345", "display_name": "John Doe"}, "status": "submitted", "transaction_date": "2021-05-01T12:00:00.000Z", "posting_date": "2024-06-01", "due_date": "2024-06-15", "currency": "USD", "currency_rate": 0.69, "sub_total": 250, "total_tax": 25, "total_amount": 1250.75, "reimbursable_amount": 1100, "memo": "Business travel expenses for Q1 client meetings", "department": {"id": "12345", "display_id": "123456", "name": "Acme Inc.", "downstream_id": "12345"}, "location": {"id": "123456", "display_id": "123456", "name": "New York Office", "downstream_id": "12345"}, "account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "accounting_period": {"id": "12345", "name": "Q1 2024"}, "line_items": [{"id": "12345", "expense_category": {"id": "12345", "name": "Travel"}, "account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "description": "Flight to New York", "quantity": 1, "unit_price": 27500.5, "amount": 275, "tax_rate": {"id": "123456", "code": "N-T", "name": "GST on Purchases", "rate": 10}, "tax_amount": 27.5, "total_amount": 302.5, "transaction_date": "2024-05-15", "billable": true, "reimbursable": true, "customer": {"id": "12345", "display_id": "CUST00101", "display_name": "Windsurf Shop", "company_name": "The boring company", "email": "boring@boring.com"}, "department": {"id": "12345", "display_id": "123456", "name": "Acme Inc.", "downstream_id": "12345"}, "location": null, "tracking_categories": [{"id": "123456", "code": "100", "name": "New York", "parent_id": "123456", "parent_name": "New York"}], "receipt_url": "https://example.com/receipts/123.pdf", "currency": "USD"}], "subsidiary": {"id": "12345", "display_id": "123456", "name": "Acme Inc."}, "tracking_categories": [{"id": "123456", "code": "100", "name": "New York", "parent_id": "123456", "parent_name": "New York"}], "tax_inclusive": true, "approved_by": {"id": "12345", "display_name": "Jane Smith"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.expenseReportsUpdate: + speakeasy-default-accounting-expense-reports-update: + parameters: + path: + id: "" + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + requestBody: + application/json: {"display_id": "123456", "number": "ER-001", "title": "Q1 Business Travel", "employee": {"id": "12345", "display_name": "John Doe"}, "status": "submitted", "transaction_date": "2021-05-01T12:00:00.000Z", "posting_date": "2024-06-01", "due_date": "2024-06-15", "currency": "USD", "currency_rate": 0.69, "sub_total": 250, "total_tax": 25, "total_amount": 1250.75, "reimbursable_amount": 1100, "memo": "Business travel expenses for Q1 client meetings", "department": {"display_id": "123456", "name": "Acme Inc."}, "location": {"id": "123456", "display_id": "123456", "name": "New York Office"}, "account": {"id": "123456", "name": "Bank account", "nominal_code": "N091", "code": "453", "parent_id": "123456", "display_id": "123456"}, "accounting_period": {"id": "12345", "name": "Q1 2024"}, "line_items": [], "subsidiary": {"display_id": "123456", "name": "Acme Inc."}, "tracking_categories": null, "tax_inclusive": true, "approved_by": {"id": "12345", "display_name": "Jane Smith"}, "custom_fields": [{"id": "2389328923893298", "name": "employee_level", "description": "Employee Level", "value": "Uses Salesforce and Marketo"}], "row_version": "1-12345", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]} + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "netsuite", "resource": "ExpenseReports", "operation": "update", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + accounting.expenseReportsDelete: + speakeasy-default-accounting-expense-reports-delete: + parameters: + path: + id: "" + query: + raw: false + header: + x-apideck-consumer-id: "test-consumer" + x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" + x-apideck-service-id: "salesforce" + responses: + "200": + application/json: {"status_code": 200, "status": "OK", "service": "netsuite", "resource": "ExpenseReports", "operation": "delete", "data": {"id": "12345"}} + "400": + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror", "downstream_errors": [{"message": "Account code '100' has been archived or deleted", "detail": "Each line item must reference a valid account", "code": "VALIDATION_ERROR"}]} + "401": + application/json: {"status_code": 401, "error": "Unauthorized", "type_name": "UnauthorizedError", "message": "Unauthorized Request", "detail": "Missing authentication", "ref": "https://developers.apideck.com/errors#unauthorizederror"} + "402": + application/json: {"status_code": 402, "error": "Payment Required", "type_name": "RequestLimitError", "message": "Request Limit Reached", "detail": "You have reached your limit of 2000", "ref": "https://developers.apideck.com/errors#requestlimiterror"} + "404": + application/json: {"status_code": 404, "error": "Not Found", "type_name": "EntityNotFoundError", "message": "Unknown Widget", "detail": "Could not find widget with id: '123'", "ref": "https://developers.apideck.com/errors#entitynotfounderror"} + "422": + application/json: {"status_code": 422, "error": "Unprocessable Entity", "type_name": "InvalidStateError", "message": "Invalid State", "detail": "Unprocessable request, please verify your request headers and body.", "ref": "https://developers.apideck.com/errors#invalidstateerror"} + default: + application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"} examplesVersion: 1.0.2 generatedTests: {} -releaseNotes: "## Java SDK Changes:\n* `apideck.proxy.get()`: **Added**\n* `apideck.proxy.options()`: **Added**\n* `apideck.proxy.post()`: **Added**\n* `apideck.proxy.put()`: **Added**\n* `apideck.proxy.patch()`: **Added**\n* `apideck.proxy.delete()`: **Added**\n* `apideck.accounting.invoiceItems.list()`: \n * `request.filter` **Changed**\n* `apideck.crm.companies.list()`: \n * `request.filter` **Changed**\n* `apideck.crm.contacts.list()`: \n * `request.filter` **Changed**\n* `apideck.crm.contacts.get()`: \n * `request.filter` **Changed**\n* `apideck.ecommerce.customers.list()`: \n * `request.filter` **Changed**\n* `apideck.hris.employees.list()`: `response.data[].leavingReason.enum(retired)` **Added**\n* `apideck.hris.employees.create()`: \n * `request.employee.leavingReason.enum(retired)` **Added**\n* `apideck.hris.employees.get()`: `response.data.leavingReason.enum(retired)` **Added**\n* `apideck.hris.employees.update()`: \n * `request.employee.leavingReason.enum(retired)` **Added**\n* `apideck.hris.employeeSchedules.list()`: `response.data.employee.leavingReason.enum(retired)` **Added**\n" +releaseNotes: | + ## Java SDK Changes: + * `apideck.accounting.employees.list()`: **Added** + * `apideck.accounting.employees.create()`: **Added** + * `apideck.accounting.employees.get()`: **Added** + * `apideck.accounting.employees.update()`: **Added** + * `apideck.accounting.employees.delete()`: **Added** + * `apideck.accounting.expenseCategories.list()`: **Added** + * `apideck.accounting.expenseCategories.create()`: **Added** + * `apideck.accounting.expenseCategories.get()`: **Added** + * `apideck.accounting.expenseCategories.update()`: **Added** + * `apideck.accounting.expenseCategories.delete()`: **Added** + * `apideck.accounting.expenseReports.list()`: **Added** + * `apideck.accounting.expenseReports.create()`: **Added** + * `apideck.accounting.expenseReports.get()`: **Added** + * `apideck.accounting.expenseReports.update()`: **Added** + * `apideck.accounting.expenseReports.delete()`: **Added** generatedFiles: - .gitattributes - USAGE.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index d8b5a021f..cb6f32218 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -14,6 +14,7 @@ generation: securityFeb2025: false sharedErrorComponentsApr2025: false sharedNestedComponentsJan2026: false + nameOverrideFeb2026: false auth: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: true @@ -28,7 +29,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false java: - version: 0.30.3 + version: 0.30.4 additionalDependencies: [] additionalPlugins: [] artifactID: unify @@ -40,6 +41,7 @@ java: companyURL: www.apideck.com defaultErrorName: APIException enableCustomCodeRegions: false + enableFormatting: false enableSlf4jLogging: false enableStreamingUploads: false flattenGlobalSecurity: true @@ -62,6 +64,7 @@ java: languageVersion: 11 license: name: Apache 2.0 + shortName: MIT url: https://www.apache.org/licenses/LICENSE-2.0.html maxMethodParams: 4 multipartArrayFormat: legacy diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 141c60797..1aeb11b7d 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.718.0 +speakeasyVersion: 1.725.0 sources: Apideck-OAS: sourceNamespace: apideck-oas - sourceRevisionDigest: sha256:d773c28cce8bc199eed59912b0b2d206b3e6b8922197e49c256027adb8af3373 - sourceBlobDigest: sha256:3480dfc2f532385385ec9c0230b6ecc8ba09968399eec030c6f5ba52a4b108c6 + sourceRevisionDigest: sha256:c1fcb7a546b5d8ed96243638368058b4c7234b963f352913c0a12bd14cad241c + sourceBlobDigest: sha256:aaafdac7bdd4f4b8a50ad8a6b034a9b7b0d1e84e2c6e71ac2039c501caba34b9 tags: - latest - - speakeasy-sdk-regen-1770639103 - - 10.23.19 + - speakeasy-sdk-regen-1771345444 + - 10.23.21 targets: apideck: source: Apideck-OAS sourceNamespace: apideck-oas - sourceRevisionDigest: sha256:d773c28cce8bc199eed59912b0b2d206b3e6b8922197e49c256027adb8af3373 - sourceBlobDigest: sha256:3480dfc2f532385385ec9c0230b6ecc8ba09968399eec030c6f5ba52a4b108c6 + sourceRevisionDigest: sha256:c1fcb7a546b5d8ed96243638368058b4c7234b963f352913c0a12bd14cad241c + sourceBlobDigest: sha256:aaafdac7bdd4f4b8a50ad8a6b034a9b7b0d1e84e2c6e71ac2039c501caba34b9 codeSamplesNamespace: apideck-oas-java-code-samples - codeSamplesRevisionDigest: sha256:87149ed4ce9e8386b664d561ee415f348ca3d6d9413ef2fec61b5f723bdc7547 + codeSamplesRevisionDigest: sha256:f1e87e8e4b7b264f59eddf0ace5f4627a77b640881de316af4346650f1975104 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index ad8676de1..d4131b674 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'com.apideck:unify:0.30.3' +implementation 'com.apideck:unify:0.30.4' ``` Maven: @@ -58,7 +58,7 @@ Maven: com.apideck unify - 0.30.3 + 0.30.4 ``` @@ -282,6 +282,30 @@ public class Application { * [update](docs/sdks/departments/README.md#update) - Update Department * [delete](docs/sdks/departments/README.md#delete) - Delete Department +### [Accounting.Employees](docs/sdks/employees/README.md) + +* [list](docs/sdks/employees/README.md#list) - List Employees +* [create](docs/sdks/employees/README.md#create) - Create Employee +* [get](docs/sdks/employees/README.md#get) - Get Employee +* [update](docs/sdks/employees/README.md#update) - Update Employee +* [delete](docs/sdks/employees/README.md#delete) - Delete Employee + +### [Accounting.ExpenseCategories](docs/sdks/expensecategories/README.md) + +* [list](docs/sdks/expensecategories/README.md#list) - List Expense Categories +* [create](docs/sdks/expensecategories/README.md#create) - Create Expense Category +* [get](docs/sdks/expensecategories/README.md#get) - Get Expense Category +* [update](docs/sdks/expensecategories/README.md#update) - Update Expense Category +* [delete](docs/sdks/expensecategories/README.md#delete) - Delete Expense Category + +### [Accounting.ExpenseReports](docs/sdks/expensereports/README.md) + +* [list](docs/sdks/expensereports/README.md#list) - List Expense Reports +* [create](docs/sdks/expensereports/README.md#create) - Create Expense Report +* [get](docs/sdks/expensereports/README.md#get) - Get Expense Report +* [update](docs/sdks/expensereports/README.md#update) - Update Expense Report +* [delete](docs/sdks/expensereports/README.md#delete) - Delete Expense Report + ### [Accounting.Expenses](docs/sdks/expenses/README.md) * [list](docs/sdks/expenses/README.md#list) - List Expenses @@ -615,13 +639,13 @@ public class Application { * [list](docs/sdks/employeepayrolls/README.md#list) - List Employee Payrolls * [get](docs/sdks/employeepayrolls/README.md#get) - Get Employee Payroll -### [Hris.Employees](docs/sdks/employees/README.md) +### [Hris.Employees](docs/sdks/apideckemployees/README.md) -* [list](docs/sdks/employees/README.md#list) - List Employees -* [create](docs/sdks/employees/README.md#create) - Create Employee -* [get](docs/sdks/employees/README.md#get) - Get Employee -* [update](docs/sdks/employees/README.md#update) - Update Employee -* [delete](docs/sdks/employees/README.md#delete) - Delete Employee +* [list](docs/sdks/apideckemployees/README.md#list) - List Employees +* [create](docs/sdks/apideckemployees/README.md#create) - Create Employee +* [get](docs/sdks/apideckemployees/README.md#get) - Get Employee +* [update](docs/sdks/apideckemployees/README.md#update) - Update Employee +* [delete](docs/sdks/apideckemployees/README.md#delete) - Delete Employee ### [Hris.EmployeeSchedules](docs/sdks/employeeschedules/README.md) @@ -1129,7 +1153,7 @@ public class Application { many more subclasses in the JDK platform). **Inherit from [`ApideckError`](./src/main/java/models/errors/ApideckError.java)**: -* [`com.apideck.unify.models.errors.Unauthorized`](./src/main/java/models/errors/com.apideck.unify.models.errors.Unauthorized.java): Unauthorized. Status code `401`. Applicable to 6 of 310 methods.* +* [`com.apideck.unify.models.errors.Unauthorized`](./src/main/java/models/errors/com.apideck.unify.models.errors.Unauthorized.java): Unauthorized. Status code `401`. Applicable to 6 of 325 methods.* diff --git a/RELEASES.md b/RELEASES.md index ebc6b89bd..30ec98ad1 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -718,4 +718,14 @@ Based on: ### Generated - [java v0.30.3] . ### Releases -- [Maven Central v0.30.3] https://central.sonatype.com/artifact/com.apideck/unify/0.30.3 - . \ No newline at end of file +- [Maven Central v0.30.3] https://central.sonatype.com/artifact/com.apideck/unify/0.30.3 - . + +## 2026-02-24 02:08:53 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.725.0 (2.836.5) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v0.30.4] . +### Releases +- [Maven Central v0.30.4] https://central.sonatype.com/artifact/com.apideck/unify/0.30.4 - . \ No newline at end of file diff --git a/docs/models/components/AccountingEmployee.md b/docs/models/components/AccountingEmployee.md new file mode 100644 index 000000000..2a3295d17 --- /dev/null +++ b/docs/models/components/AccountingEmployee.md @@ -0,0 +1,37 @@ +# AccountingEmployee + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional\* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `downstreamId` | *JsonNullable\* | :heavy_minus_sign: | The third-party API ID of original entity | 12345 | +| `displayId` | *JsonNullable\* | :heavy_minus_sign: | Id to be displayed. | 123456 | +| `firstName` | *JsonNullable\* | :heavy_minus_sign: | The first name of the employee. | John | +| `lastName` | *JsonNullable\* | :heavy_minus_sign: | The last name of the employee. | Doe | +| `displayName` | *JsonNullable\* | :heavy_minus_sign: | The display name of the employee. | John Doe | +| `emails` | List\<[Email](../../models/components/Email.md)> | :heavy_minus_sign: | Email addresses of the employee. | | +| `employeeNumber` | *JsonNullable\* | :heavy_minus_sign: | The employee number or identifier. | EMP-001 | +| `jobTitle` | *JsonNullable\* | :heavy_minus_sign: | The job title of the employee. | Senior Accountant | +| `status` | [JsonNullable\](../../models/components/EmployeeStatus.md) | :heavy_minus_sign: | The status of the employee. | active | +| `isContractor` | *JsonNullable\* | :heavy_minus_sign: | Whether the employee is a contractor. | false | +| `department` | [JsonNullable\](../../models/components/LinkedDepartment.md) | :heavy_minus_sign: | N/A | | +| `location` | [JsonNullable\](../../models/components/LinkedLocation.md) | :heavy_minus_sign: | N/A | | +| `manager` | [Optional\](../../models/components/AccountingEmployeeManager.md) | :heavy_minus_sign: | The manager of the employee. | | +| `hireDate` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | The date the employee was hired. | 2020-01-15 | +| `terminationDate` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | The date the employee was terminated. | 2025-12-31 | +| `gender` | [JsonNullable\](../../models/components/Gender.md) | :heavy_minus_sign: | The gender represents the gender identity of a person. | male | +| `birthDate` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | The date of birth of the employee. | 1990-05-20 | +| `subsidiary` | [JsonNullable\](../../models/components/LinkedSubsidiary.md) | :heavy_minus_sign: | N/A | | +| `trackingCategories` | List\<[LinkedTrackingCategory](../../models/components/LinkedTrackingCategory.md)> | :heavy_minus_sign: | A list of linked tracking categories. | | +| `currency` | [JsonNullable\](../../models/components/Currency.md) | :heavy_minus_sign: | Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). | USD | +| `notes` | *JsonNullable\* | :heavy_minus_sign: | Notes about the employee. | Some notes about this employee | +| `addresses` | List\<[Address](../../models/components/Address.md)> | :heavy_minus_sign: | Addresses of the employee. | | +| `phoneNumbers` | List\<[PhoneNumber](../../models/components/PhoneNumber.md)> | :heavy_minus_sign: | Phone numbers of the employee. | | +| `customFields` | List\<[CustomField](../../models/components/CustomField.md)> | :heavy_minus_sign: | N/A | | +| `customMappings` | Map\ | :heavy_minus_sign: | When custom mappings are configured on the resource, the result is included here. | | +| `rowVersion` | *JsonNullable\* | :heavy_minus_sign: | A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. | 1-12345 | +| `updatedAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | The date and time when the object was last updated. | 2020-09-30T07:43:32.000Z | +| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | The date and time when the object was created. | 2020-09-30T07:43:32.000Z | +| `passThrough` | List\<[PassThroughBody](../../models/components/PassThroughBody.md)> | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | \ No newline at end of file diff --git a/docs/models/components/AccountingEmployeeInput.md b/docs/models/components/AccountingEmployeeInput.md new file mode 100644 index 000000000..2f0109c88 --- /dev/null +++ b/docs/models/components/AccountingEmployeeInput.md @@ -0,0 +1,32 @@ +# AccountingEmployeeInput + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `displayId` | *JsonNullable\* | :heavy_minus_sign: | Id to be displayed. | 123456 | +| `firstName` | *JsonNullable\* | :heavy_minus_sign: | The first name of the employee. | John | +| `lastName` | *JsonNullable\* | :heavy_minus_sign: | The last name of the employee. | Doe | +| `displayName` | *JsonNullable\* | :heavy_minus_sign: | The display name of the employee. | John Doe | +| `emails` | List\<[Email](../../models/components/Email.md)> | :heavy_minus_sign: | Email addresses of the employee. | | +| `employeeNumber` | *JsonNullable\* | :heavy_minus_sign: | The employee number or identifier. | EMP-001 | +| `jobTitle` | *JsonNullable\* | :heavy_minus_sign: | The job title of the employee. | Senior Accountant | +| `status` | [JsonNullable\](../../models/components/EmployeeStatus.md) | :heavy_minus_sign: | The status of the employee. | active | +| `isContractor` | *JsonNullable\* | :heavy_minus_sign: | Whether the employee is a contractor. | false | +| `department` | [JsonNullable\](../../models/components/LinkedDepartmentInput.md) | :heavy_minus_sign: | N/A | | +| `location` | [JsonNullable\](../../models/components/LinkedLocationInput.md) | :heavy_minus_sign: | N/A | | +| `manager` | [Optional\](../../models/components/AccountingEmployeeManager.md) | :heavy_minus_sign: | The manager of the employee. | | +| `hireDate` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | The date the employee was hired. | 2020-01-15 | +| `terminationDate` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | The date the employee was terminated. | 2025-12-31 | +| `gender` | [JsonNullable\](../../models/components/Gender.md) | :heavy_minus_sign: | The gender represents the gender identity of a person. | male | +| `birthDate` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | The date of birth of the employee. | 1990-05-20 | +| `subsidiary` | [JsonNullable\](../../models/components/LinkedSubsidiaryInput.md) | :heavy_minus_sign: | N/A | | +| `trackingCategories` | List\<[LinkedTrackingCategory](../../models/components/LinkedTrackingCategory.md)> | :heavy_minus_sign: | A list of linked tracking categories. | | +| `currency` | [JsonNullable\](../../models/components/Currency.md) | :heavy_minus_sign: | Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). | USD | +| `notes` | *JsonNullable\* | :heavy_minus_sign: | Notes about the employee. | Some notes about this employee | +| `addresses` | List\<[Address](../../models/components/Address.md)> | :heavy_minus_sign: | Addresses of the employee. | | +| `phoneNumbers` | List\<[PhoneNumber](../../models/components/PhoneNumber.md)> | :heavy_minus_sign: | Phone numbers of the employee. | | +| `customFields` | List\<[CustomField](../../models/components/CustomField.md)> | :heavy_minus_sign: | N/A | | +| `rowVersion` | *JsonNullable\* | :heavy_minus_sign: | A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. | 1-12345 | +| `passThrough` | List\<[PassThroughBody](../../models/components/PassThroughBody.md)> | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | \ No newline at end of file diff --git a/docs/models/components/AccountingEmployeeManager.md b/docs/models/components/AccountingEmployeeManager.md new file mode 100644 index 000000000..add85ee97 --- /dev/null +++ b/docs/models/components/AccountingEmployeeManager.md @@ -0,0 +1,11 @@ +# AccountingEmployeeManager + +The manager of the employee. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `id` | *Optional\* | :heavy_minus_sign: | A unique identifier for the manager. | 12345 | +| `name` | *JsonNullable\* | :heavy_minus_sign: | The name of the manager. | Jane Smith | \ No newline at end of file diff --git a/docs/models/components/AccountingEmployeesFilter.md b/docs/models/components/AccountingEmployeesFilter.md new file mode 100644 index 000000000..376cce42c --- /dev/null +++ b/docs/models/components/AccountingEmployeesFilter.md @@ -0,0 +1,9 @@ +# AccountingEmployeesFilter + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `updatedSince` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | N/A | 2020-09-30T07:43:32.000Z | +| `status` | [Optional\](../../models/components/AccountingEmployeesFilterStatus.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/AccountingEmployeesFilterStatus.md b/docs/models/components/AccountingEmployeesFilterStatus.md new file mode 100644 index 000000000..a498983e5 --- /dev/null +++ b/docs/models/components/AccountingEmployeesFilterStatus.md @@ -0,0 +1,10 @@ +# AccountingEmployeesFilterStatus + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `ACTIVE` | active | +| `INACTIVE` | inactive | +| `TERMINATED` | terminated | \ No newline at end of file diff --git a/docs/models/components/AccountingPeriod.md b/docs/models/components/AccountingPeriod.md new file mode 100644 index 000000000..c5f6d6027 --- /dev/null +++ b/docs/models/components/AccountingPeriod.md @@ -0,0 +1,11 @@ +# AccountingPeriod + +The accounting period the expense report is posted to. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `id` | *Optional\* | :heavy_minus_sign: | A unique identifier for the accounting period. | 12345 | +| `name` | *JsonNullable\* | :heavy_minus_sign: | The name of the accounting period. | Q1 2024 | \ No newline at end of file diff --git a/docs/models/components/ApprovedBy.md b/docs/models/components/ApprovedBy.md new file mode 100644 index 000000000..00efa9704 --- /dev/null +++ b/docs/models/components/ApprovedBy.md @@ -0,0 +1,11 @@ +# ApprovedBy + +The person who approved the expense report. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `id` | *Optional\* | :heavy_minus_sign: | A unique identifier for the approver. | 12345 | +| `displayName` | *JsonNullable\* | :heavy_minus_sign: | The display name of the approver. | Jane Smith | \ No newline at end of file diff --git a/docs/models/components/CreateAccountingEmployeeResponse.md b/docs/models/components/CreateAccountingEmployeeResponse.md new file mode 100644 index 000000000..0210cad84 --- /dev/null +++ b/docs/models/components/CreateAccountingEmployeeResponse.md @@ -0,0 +1,16 @@ +# CreateAccountingEmployeeResponse + +Employees + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | quickbooks | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | Employees | +| `operation` | *String* | :heavy_check_mark: | Operation performed | add | +| `data` | [UnifiedId](../../models/components/UnifiedId.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/components/CreateExpenseCategoryResponse.md b/docs/models/components/CreateExpenseCategoryResponse.md new file mode 100644 index 000000000..e0fc32dcf --- /dev/null +++ b/docs/models/components/CreateExpenseCategoryResponse.md @@ -0,0 +1,16 @@ +# CreateExpenseCategoryResponse + +Expense Categories + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | netsuite | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | ExpenseCategories | +| `operation` | *String* | :heavy_check_mark: | Operation performed | add | +| `data` | [UnifiedId](../../models/components/UnifiedId.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/components/CreateExpenseReportResponse.md b/docs/models/components/CreateExpenseReportResponse.md new file mode 100644 index 000000000..7b4d6af51 --- /dev/null +++ b/docs/models/components/CreateExpenseReportResponse.md @@ -0,0 +1,16 @@ +# CreateExpenseReportResponse + +Expense Reports + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | netsuite | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | ExpenseReports | +| `operation` | *String* | :heavy_check_mark: | Operation performed | add | +| `data` | [UnifiedId](../../models/components/UnifiedId.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/components/DeleteAccountingEmployeeResponse.md b/docs/models/components/DeleteAccountingEmployeeResponse.md new file mode 100644 index 000000000..aed8ff138 --- /dev/null +++ b/docs/models/components/DeleteAccountingEmployeeResponse.md @@ -0,0 +1,16 @@ +# DeleteAccountingEmployeeResponse + +Employees + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | quickbooks | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | Employees | +| `operation` | *String* | :heavy_check_mark: | Operation performed | delete | +| `data` | [UnifiedId](../../models/components/UnifiedId.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/components/DeleteExpenseCategoryResponse.md b/docs/models/components/DeleteExpenseCategoryResponse.md new file mode 100644 index 000000000..ec739207f --- /dev/null +++ b/docs/models/components/DeleteExpenseCategoryResponse.md @@ -0,0 +1,16 @@ +# DeleteExpenseCategoryResponse + +Expense Categories + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | netsuite | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | ExpenseCategories | +| `operation` | *String* | :heavy_check_mark: | Operation performed | delete | +| `data` | [UnifiedId](../../models/components/UnifiedId.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/components/DeleteExpenseReportResponse.md b/docs/models/components/DeleteExpenseReportResponse.md new file mode 100644 index 000000000..28b713797 --- /dev/null +++ b/docs/models/components/DeleteExpenseReportResponse.md @@ -0,0 +1,16 @@ +# DeleteExpenseReportResponse + +Expense Reports + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | netsuite | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | ExpenseReports | +| `operation` | *String* | :heavy_check_mark: | Operation performed | delete | +| `data` | [UnifiedId](../../models/components/UnifiedId.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/components/EmployeeStatus.md b/docs/models/components/EmployeeStatus.md new file mode 100644 index 000000000..1b41574be --- /dev/null +++ b/docs/models/components/EmployeeStatus.md @@ -0,0 +1,12 @@ +# EmployeeStatus + +The status of the employee. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `ACTIVE` | active | +| `INACTIVE` | inactive | +| `TERMINATED` | terminated | \ No newline at end of file diff --git a/docs/models/components/ExpenseCategoriesFilter.md b/docs/models/components/ExpenseCategoriesFilter.md new file mode 100644 index 000000000..10c887083 --- /dev/null +++ b/docs/models/components/ExpenseCategoriesFilter.md @@ -0,0 +1,9 @@ +# ExpenseCategoriesFilter + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `updatedSince` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | N/A | 2020-09-30T07:43:32.000Z | +| `status` | [Optional\](../../models/components/ExpenseCategoriesFilterStatus.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/ExpenseCategoriesFilterStatus.md b/docs/models/components/ExpenseCategoriesFilterStatus.md new file mode 100644 index 000000000..244159d01 --- /dev/null +++ b/docs/models/components/ExpenseCategoriesFilterStatus.md @@ -0,0 +1,9 @@ +# ExpenseCategoriesFilterStatus + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `ACTIVE` | active | +| `INACTIVE` | inactive | \ No newline at end of file diff --git a/docs/models/components/ExpenseCategory.md b/docs/models/components/ExpenseCategory.md new file mode 100644 index 000000000..039131de7 --- /dev/null +++ b/docs/models/components/ExpenseCategory.md @@ -0,0 +1,23 @@ +# ExpenseCategory + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional\* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `displayId` | *JsonNullable\* | :heavy_minus_sign: | Id to be displayed. | 123456 | +| `name` | *String* | :heavy_check_mark: | The name of the expense category. | Travel | +| `code` | *JsonNullable\* | :heavy_minus_sign: | The code or external identifier of the expense category. | TRAVEL-001 | +| `description` | *JsonNullable\* | :heavy_minus_sign: | The description of the expense category. | Travel-related expenses including flights, hotels, and ground transportation. | +| `status` | [JsonNullable\](../../models/components/ExpenseCategoryStatus.md) | :heavy_minus_sign: | The status of the expense category. | active | +| `account` | [JsonNullable\](../../models/components/LinkedLedgerAccount.md) | :heavy_minus_sign: | N/A | | +| `offsetAccount` | [JsonNullable\](../../models/components/LinkedLedgerAccount.md) | :heavy_minus_sign: | N/A | | +| `taxRate` | [Optional\](../../models/components/LinkedTaxRate.md) | :heavy_minus_sign: | N/A | | +| `rateRequired` | *JsonNullable\* | :heavy_minus_sign: | Whether the expense category requires rate/quantity entry (e.g. mileage at $/mile). | false | +| `defaultRate` | *JsonNullable\* | :heavy_minus_sign: | Default rate when rate_required is true (e.g. 0.67 for mileage). | 0.67 | +| `customMappings` | Map\ | :heavy_minus_sign: | When custom mappings are configured on the resource, the result is included here. | | +| `rowVersion` | *JsonNullable\* | :heavy_minus_sign: | A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. | 1-12345 | +| `updatedAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | The date and time when the object was last updated. | 2020-09-30T07:43:32.000Z | +| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | The date and time when the object was created. | 2020-09-30T07:43:32.000Z | +| `passThrough` | List\<[PassThroughBody](../../models/components/PassThroughBody.md)> | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | \ No newline at end of file diff --git a/docs/models/components/ExpenseCategoryInput.md b/docs/models/components/ExpenseCategoryInput.md new file mode 100644 index 000000000..7444a5dd2 --- /dev/null +++ b/docs/models/components/ExpenseCategoryInput.md @@ -0,0 +1,19 @@ +# ExpenseCategoryInput + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `displayId` | *JsonNullable\* | :heavy_minus_sign: | Id to be displayed. | 123456 | +| `name` | *String* | :heavy_check_mark: | The name of the expense category. | Travel | +| `code` | *JsonNullable\* | :heavy_minus_sign: | The code or external identifier of the expense category. | TRAVEL-001 | +| `description` | *JsonNullable\* | :heavy_minus_sign: | The description of the expense category. | Travel-related expenses including flights, hotels, and ground transportation. | +| `status` | [JsonNullable\](../../models/components/ExpenseCategoryStatus.md) | :heavy_minus_sign: | The status of the expense category. | active | +| `account` | [JsonNullable\](../../models/components/LinkedLedgerAccount.md) | :heavy_minus_sign: | N/A | | +| `offsetAccount` | [JsonNullable\](../../models/components/LinkedLedgerAccount.md) | :heavy_minus_sign: | N/A | | +| `taxRate` | [Optional\](../../models/components/LinkedTaxRateInput.md) | :heavy_minus_sign: | N/A | | +| `rateRequired` | *JsonNullable\* | :heavy_minus_sign: | Whether the expense category requires rate/quantity entry (e.g. mileage at $/mile). | false | +| `defaultRate` | *JsonNullable\* | :heavy_minus_sign: | Default rate when rate_required is true (e.g. 0.67 for mileage). | 0.67 | +| `rowVersion` | *JsonNullable\* | :heavy_minus_sign: | A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. | 1-12345 | +| `passThrough` | List\<[PassThroughBody](../../models/components/PassThroughBody.md)> | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | \ No newline at end of file diff --git a/docs/models/components/ExpenseCategoryStatus.md b/docs/models/components/ExpenseCategoryStatus.md new file mode 100644 index 000000000..fb30f72f6 --- /dev/null +++ b/docs/models/components/ExpenseCategoryStatus.md @@ -0,0 +1,11 @@ +# ExpenseCategoryStatus + +The status of the expense category. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `ACTIVE` | active | +| `INACTIVE` | inactive | \ No newline at end of file diff --git a/docs/models/components/ExpenseReport.md b/docs/models/components/ExpenseReport.md new file mode 100644 index 000000000..8b2f238c7 --- /dev/null +++ b/docs/models/components/ExpenseReport.md @@ -0,0 +1,38 @@ +# ExpenseReport + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional\* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `displayId` | *JsonNullable\* | :heavy_minus_sign: | Id to be displayed. | 123456 | +| `number` | *JsonNullable\* | :heavy_minus_sign: | The expense report number. | ER-001 | +| `title` | *JsonNullable\* | :heavy_minus_sign: | Title or purpose of the expense report. | Q1 Business Travel | +| `employee` | [ExpenseReportEmployee](../../models/components/ExpenseReportEmployee.md) | :heavy_check_mark: | The employee who submitted the expense report. | | +| `status` | [JsonNullable\](../../models/components/ExpenseReportStatus.md) | :heavy_minus_sign: | The status of the expense report. | submitted | +| `transactionDate` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `postingDate` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | The date the expense report was posted to the general ledger. | 2024-06-01 | +| `dueDate` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | Date when reimbursement is due. | 2024-06-15 | +| `currency` | [JsonNullable\](../../models/components/Currency.md) | :heavy_minus_sign: | Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). | USD | +| `currencyRate` | *JsonNullable\* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `subTotal` | *JsonNullable\* | :heavy_minus_sign: | Subtotal amount, normally before tax. | 250 | +| `totalTax` | *JsonNullable\* | :heavy_minus_sign: | Total tax amount applied to this transaction. | 25 | +| `totalAmount` | *JsonNullable\* | :heavy_minus_sign: | Total amount of all expense lines including tax. | 1250.75 | +| `reimbursableAmount` | *JsonNullable\* | :heavy_minus_sign: | Total reimbursable amount (may differ from total if some expenses are non-reimbursable). | 1100 | +| `memo` | *JsonNullable\* | :heavy_minus_sign: | The memo of the expense report. | Business travel expenses for Q1 client meetings | +| `department` | [JsonNullable\](../../models/components/LinkedDepartment.md) | :heavy_minus_sign: | N/A | | +| `location` | [JsonNullable\](../../models/components/LinkedLocation.md) | :heavy_minus_sign: | N/A | | +| `account` | [JsonNullable\](../../models/components/LinkedLedgerAccount.md) | :heavy_minus_sign: | N/A | | +| `accountingPeriod` | [JsonNullable\](../../models/components/AccountingPeriod.md) | :heavy_minus_sign: | The accounting period the expense report is posted to. | | +| `lineItems` | List\<[ExpenseReportLineItem](../../models/components/ExpenseReportLineItem.md)> | :heavy_check_mark: | Expense line items linked to this expense report. | | +| `subsidiary` | [JsonNullable\](../../models/components/LinkedSubsidiary.md) | :heavy_minus_sign: | N/A | | +| `trackingCategories` | List\<[LinkedTrackingCategory](../../models/components/LinkedTrackingCategory.md)> | :heavy_minus_sign: | A list of linked tracking categories. | | +| `taxInclusive` | *JsonNullable\* | :heavy_minus_sign: | Amounts are including tax | true | +| `approvedBy` | [JsonNullable\](../../models/components/ApprovedBy.md) | :heavy_minus_sign: | The person who approved the expense report. | | +| `customFields` | List\<[CustomField](../../models/components/CustomField.md)> | :heavy_minus_sign: | N/A | | +| `customMappings` | Map\ | :heavy_minus_sign: | When custom mappings are configured on the resource, the result is included here. | | +| `rowVersion` | *JsonNullable\* | :heavy_minus_sign: | A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. | 1-12345 | +| `updatedAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | The date and time when the object was last updated. | 2020-09-30T07:43:32.000Z | +| `createdAt` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | The date and time when the object was created. | 2020-09-30T07:43:32.000Z | +| `passThrough` | List\<[PassThroughBody](../../models/components/PassThroughBody.md)> | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | \ No newline at end of file diff --git a/docs/models/components/ExpenseReportEmployee.md b/docs/models/components/ExpenseReportEmployee.md new file mode 100644 index 000000000..eb4e288df --- /dev/null +++ b/docs/models/components/ExpenseReportEmployee.md @@ -0,0 +1,11 @@ +# ExpenseReportEmployee + +The employee who submitted the expense report. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `id` | *Optional\* | :heavy_minus_sign: | A unique identifier for the employee. | 12345 | +| `displayName` | *JsonNullable\* | :heavy_minus_sign: | The display name of the employee. | John Doe | \ No newline at end of file diff --git a/docs/models/components/ExpenseReportInput.md b/docs/models/components/ExpenseReportInput.md new file mode 100644 index 000000000..b26adbadb --- /dev/null +++ b/docs/models/components/ExpenseReportInput.md @@ -0,0 +1,34 @@ +# ExpenseReportInput + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `displayId` | *JsonNullable\* | :heavy_minus_sign: | Id to be displayed. | 123456 | +| `number` | *JsonNullable\* | :heavy_minus_sign: | The expense report number. | ER-001 | +| `title` | *JsonNullable\* | :heavy_minus_sign: | Title or purpose of the expense report. | Q1 Business Travel | +| `employee` | [ExpenseReportEmployee](../../models/components/ExpenseReportEmployee.md) | :heavy_check_mark: | The employee who submitted the expense report. | | +| `status` | [JsonNullable\](../../models/components/ExpenseReportStatus.md) | :heavy_minus_sign: | The status of the expense report. | submitted | +| `transactionDate` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_check_mark: | The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD | 2021-05-01T12:00:00.000Z | +| `postingDate` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | The date the expense report was posted to the general ledger. | 2024-06-01 | +| `dueDate` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | Date when reimbursement is due. | 2024-06-15 | +| `currency` | [JsonNullable\](../../models/components/Currency.md) | :heavy_minus_sign: | Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). | USD | +| `currencyRate` | *JsonNullable\* | :heavy_minus_sign: | Currency Exchange Rate at the time entity was recorded/generated. | 0.69 | +| `subTotal` | *JsonNullable\* | :heavy_minus_sign: | Subtotal amount, normally before tax. | 250 | +| `totalTax` | *JsonNullable\* | :heavy_minus_sign: | Total tax amount applied to this transaction. | 25 | +| `totalAmount` | *JsonNullable\* | :heavy_minus_sign: | Total amount of all expense lines including tax. | 1250.75 | +| `reimbursableAmount` | *JsonNullable\* | :heavy_minus_sign: | Total reimbursable amount (may differ from total if some expenses are non-reimbursable). | 1100 | +| `memo` | *JsonNullable\* | :heavy_minus_sign: | The memo of the expense report. | Business travel expenses for Q1 client meetings | +| `department` | [JsonNullable\](../../models/components/LinkedDepartmentInput.md) | :heavy_minus_sign: | N/A | | +| `location` | [JsonNullable\](../../models/components/LinkedLocationInput.md) | :heavy_minus_sign: | N/A | | +| `account` | [JsonNullable\](../../models/components/LinkedLedgerAccount.md) | :heavy_minus_sign: | N/A | | +| `accountingPeriod` | [JsonNullable\](../../models/components/AccountingPeriod.md) | :heavy_minus_sign: | The accounting period the expense report is posted to. | | +| `lineItems` | List\<[ExpenseReportLineItemInput](../../models/components/ExpenseReportLineItemInput.md)> | :heavy_check_mark: | Expense line items linked to this expense report. | | +| `subsidiary` | [JsonNullable\](../../models/components/LinkedSubsidiaryInput.md) | :heavy_minus_sign: | N/A | | +| `trackingCategories` | List\<[LinkedTrackingCategory](../../models/components/LinkedTrackingCategory.md)> | :heavy_minus_sign: | A list of linked tracking categories. | | +| `taxInclusive` | *JsonNullable\* | :heavy_minus_sign: | Amounts are including tax | true | +| `approvedBy` | [JsonNullable\](../../models/components/ApprovedBy.md) | :heavy_minus_sign: | The person who approved the expense report. | | +| `customFields` | List\<[CustomField](../../models/components/CustomField.md)> | :heavy_minus_sign: | N/A | | +| `rowVersion` | *JsonNullable\* | :heavy_minus_sign: | A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. | 1-12345 | +| `passThrough` | List\<[PassThroughBody](../../models/components/PassThroughBody.md)> | :heavy_minus_sign: | The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. | | \ No newline at end of file diff --git a/docs/models/components/ExpenseReportLineItem.md b/docs/models/components/ExpenseReportLineItem.md new file mode 100644 index 000000000..5140f6dc3 --- /dev/null +++ b/docs/models/components/ExpenseReportLineItem.md @@ -0,0 +1,26 @@ +# ExpenseReportLineItem + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *Optional\* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `expenseCategory` | [Optional\](../../models/components/ExpenseReportLineItemExpenseCategory.md) | :heavy_minus_sign: | The expense category for this line item. | | +| `account` | [JsonNullable\](../../models/components/LinkedLedgerAccount.md) | :heavy_minus_sign: | N/A | | +| `description` | *JsonNullable\* | :heavy_minus_sign: | The description of the expense line item. | Flight to New York | +| `quantity` | *JsonNullable\* | :heavy_minus_sign: | N/A | 1 | +| `unitPrice` | *JsonNullable\* | :heavy_minus_sign: | N/A | 27500.5 | +| `amount` | *double* | :heavy_check_mark: | The amount of the expense line item. | 275 | +| `taxRate` | [Optional\](../../models/components/LinkedTaxRate.md) | :heavy_minus_sign: | N/A | | +| `taxAmount` | *JsonNullable\* | :heavy_minus_sign: | Tax amount | 27.5 | +| `totalAmount` | *JsonNullable\* | :heavy_minus_sign: | The total amount of the expense line item including tax. | 302.5 | +| `transactionDate` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | The date of the individual expense. | 2024-05-15 | +| `billable` | *JsonNullable\* | :heavy_minus_sign: | Whether the expense is billable to a customer. | true | +| `reimbursable` | *JsonNullable\* | :heavy_minus_sign: | Whether the expense is reimbursable to the employee. | true | +| `customer` | [JsonNullable\](../../models/components/LinkedCustomer.md) | :heavy_minus_sign: | The customer this entity is linked to. | | +| `department` | [JsonNullable\](../../models/components/LinkedDepartment.md) | :heavy_minus_sign: | N/A | | +| `location` | [JsonNullable\](../../models/components/LinkedLocation.md) | :heavy_minus_sign: | N/A | | +| `trackingCategories` | List\<[LinkedTrackingCategory](../../models/components/LinkedTrackingCategory.md)> | :heavy_minus_sign: | A list of linked tracking categories. | | +| `receiptUrl` | *JsonNullable\* | :heavy_minus_sign: | URL to the receipt or attachment for this expense line. | https://example.com/receipts/123.pdf | +| `currency` | [JsonNullable\](../../models/components/Currency.md) | :heavy_minus_sign: | Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). | USD | \ No newline at end of file diff --git a/docs/models/components/ExpenseReportLineItemExpenseCategory.md b/docs/models/components/ExpenseReportLineItemExpenseCategory.md new file mode 100644 index 000000000..432c22ea0 --- /dev/null +++ b/docs/models/components/ExpenseReportLineItemExpenseCategory.md @@ -0,0 +1,11 @@ +# ExpenseReportLineItemExpenseCategory + +The expense category for this line item. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `id` | *Optional\* | :heavy_minus_sign: | A unique identifier for the expense category. | 12345 | +| `name` | *JsonNullable\* | :heavy_minus_sign: | The name of the expense category. | Travel | \ No newline at end of file diff --git a/docs/models/components/ExpenseReportLineItemInput.md b/docs/models/components/ExpenseReportLineItemInput.md new file mode 100644 index 000000000..f1a9d0d1d --- /dev/null +++ b/docs/models/components/ExpenseReportLineItemInput.md @@ -0,0 +1,25 @@ +# ExpenseReportLineItemInput + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `expenseCategory` | [Optional\](../../models/components/ExpenseReportLineItemExpenseCategory.md) | :heavy_minus_sign: | The expense category for this line item. | | +| `account` | [JsonNullable\](../../models/components/LinkedLedgerAccount.md) | :heavy_minus_sign: | N/A | | +| `description` | *JsonNullable\* | :heavy_minus_sign: | The description of the expense line item. | Flight to New York | +| `quantity` | *JsonNullable\* | :heavy_minus_sign: | N/A | 1 | +| `unitPrice` | *JsonNullable\* | :heavy_minus_sign: | N/A | 27500.5 | +| `amount` | *double* | :heavy_check_mark: | The amount of the expense line item. | 275 | +| `taxRate` | [Optional\](../../models/components/LinkedTaxRateInput.md) | :heavy_minus_sign: | N/A | | +| `taxAmount` | *JsonNullable\* | :heavy_minus_sign: | Tax amount | 27.5 | +| `totalAmount` | *JsonNullable\* | :heavy_minus_sign: | The total amount of the expense line item including tax. | 302.5 | +| `transactionDate` | [LocalDate](https://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html) | :heavy_minus_sign: | The date of the individual expense. | 2024-05-15 | +| `billable` | *JsonNullable\* | :heavy_minus_sign: | Whether the expense is billable to a customer. | true | +| `reimbursable` | *JsonNullable\* | :heavy_minus_sign: | Whether the expense is reimbursable to the employee. | true | +| `customer` | [JsonNullable\](../../models/components/LinkedCustomerInput.md) | :heavy_minus_sign: | The customer this entity is linked to. | | +| `department` | [JsonNullable\](../../models/components/LinkedDepartmentInput.md) | :heavy_minus_sign: | N/A | | +| `location` | [JsonNullable\](../../models/components/LinkedLocationInput.md) | :heavy_minus_sign: | N/A | | +| `trackingCategories` | List\<[LinkedTrackingCategory](../../models/components/LinkedTrackingCategory.md)> | :heavy_minus_sign: | A list of linked tracking categories. | | +| `receiptUrl` | *JsonNullable\* | :heavy_minus_sign: | URL to the receipt or attachment for this expense line. | https://example.com/receipts/123.pdf | +| `currency` | [JsonNullable\](../../models/components/Currency.md) | :heavy_minus_sign: | Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). | USD | \ No newline at end of file diff --git a/docs/models/components/ExpenseReportStatus.md b/docs/models/components/ExpenseReportStatus.md new file mode 100644 index 000000000..f037f080d --- /dev/null +++ b/docs/models/components/ExpenseReportStatus.md @@ -0,0 +1,16 @@ +# ExpenseReportStatus + +The status of the expense report. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `DRAFT` | draft | +| `SUBMITTED` | submitted | +| `APPROVED` | approved | +| `REIMBURSED` | reimbursed | +| `REJECTED` | rejected | +| `REVERSED` | reversed | +| `VOIDED` | voided | \ No newline at end of file diff --git a/docs/models/components/ExpenseReportsFilter.md b/docs/models/components/ExpenseReportsFilter.md new file mode 100644 index 000000000..7074be8f0 --- /dev/null +++ b/docs/models/components/ExpenseReportsFilter.md @@ -0,0 +1,10 @@ +# ExpenseReportsFilter + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `updatedSince` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | N/A | 2020-09-30T07:43:32.000Z | +| `status` | [Optional\](../../models/components/ExpenseReportsFilterStatus.md) | :heavy_minus_sign: | N/A | | +| `employeeId` | *Optional\* | :heavy_minus_sign: | Filter by employee ID | 12345 | \ No newline at end of file diff --git a/docs/models/components/ExpenseReportsFilterStatus.md b/docs/models/components/ExpenseReportsFilterStatus.md new file mode 100644 index 000000000..6a56b6169 --- /dev/null +++ b/docs/models/components/ExpenseReportsFilterStatus.md @@ -0,0 +1,14 @@ +# ExpenseReportsFilterStatus + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `DRAFT` | draft | +| `SUBMITTED` | submitted | +| `APPROVED` | approved | +| `REIMBURSED` | reimbursed | +| `REJECTED` | rejected | +| `REVERSED` | reversed | +| `VOIDED` | voided | \ No newline at end of file diff --git a/docs/models/components/GetAccountingEmployeeResponse.md b/docs/models/components/GetAccountingEmployeeResponse.md new file mode 100644 index 000000000..e19b7539a --- /dev/null +++ b/docs/models/components/GetAccountingEmployeeResponse.md @@ -0,0 +1,16 @@ +# GetAccountingEmployeeResponse + +Employees + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | quickbooks | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | Employees | +| `operation` | *String* | :heavy_check_mark: | Operation performed | one | +| `data` | [AccountingEmployee](../../models/components/AccountingEmployee.md) | :heavy_check_mark: | N/A | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/components/GetAccountingEmployeesResponse.md b/docs/models/components/GetAccountingEmployeesResponse.md new file mode 100644 index 000000000..cdfdcc911 --- /dev/null +++ b/docs/models/components/GetAccountingEmployeesResponse.md @@ -0,0 +1,18 @@ +# GetAccountingEmployeesResponse + +Employees + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | quickbooks | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | Employees | +| `operation` | *String* | :heavy_check_mark: | Operation performed | all | +| `data` | List\<[AccountingEmployee](../../models/components/AccountingEmployee.md)> | :heavy_check_mark: | N/A | | +| `meta` | [Optional\](../../models/components/Meta.md) | :heavy_minus_sign: | Response metadata | | +| `links` | [Optional\](../../models/components/Links.md) | :heavy_minus_sign: | Links to navigate to previous or next pages through the API | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/components/GetExpenseCategoriesResponse.md b/docs/models/components/GetExpenseCategoriesResponse.md new file mode 100644 index 000000000..90fdc26fd --- /dev/null +++ b/docs/models/components/GetExpenseCategoriesResponse.md @@ -0,0 +1,18 @@ +# GetExpenseCategoriesResponse + +Expense Categories + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | netsuite | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | ExpenseCategories | +| `operation` | *String* | :heavy_check_mark: | Operation performed | all | +| `data` | List\<[ExpenseCategory](../../models/components/ExpenseCategory.md)> | :heavy_check_mark: | N/A | | +| `meta` | [Optional\](../../models/components/Meta.md) | :heavy_minus_sign: | Response metadata | | +| `links` | [Optional\](../../models/components/Links.md) | :heavy_minus_sign: | Links to navigate to previous or next pages through the API | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/components/GetExpenseCategoryResponse.md b/docs/models/components/GetExpenseCategoryResponse.md new file mode 100644 index 000000000..3dd3dc0a8 --- /dev/null +++ b/docs/models/components/GetExpenseCategoryResponse.md @@ -0,0 +1,16 @@ +# GetExpenseCategoryResponse + +Expense Categories + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | netsuite | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | ExpenseCategories | +| `operation` | *String* | :heavy_check_mark: | Operation performed | one | +| `data` | [ExpenseCategory](../../models/components/ExpenseCategory.md) | :heavy_check_mark: | N/A | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/components/GetExpenseReportResponse.md b/docs/models/components/GetExpenseReportResponse.md new file mode 100644 index 000000000..a986ed7f9 --- /dev/null +++ b/docs/models/components/GetExpenseReportResponse.md @@ -0,0 +1,16 @@ +# GetExpenseReportResponse + +Expense Reports + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | netsuite | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | ExpenseReports | +| `operation` | *String* | :heavy_check_mark: | Operation performed | one | +| `data` | [ExpenseReport](../../models/components/ExpenseReport.md) | :heavy_check_mark: | N/A | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/components/GetExpenseReportsResponse.md b/docs/models/components/GetExpenseReportsResponse.md new file mode 100644 index 000000000..9d9ed5490 --- /dev/null +++ b/docs/models/components/GetExpenseReportsResponse.md @@ -0,0 +1,18 @@ +# GetExpenseReportsResponse + +Expense Reports + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | netsuite | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | ExpenseReports | +| `operation` | *String* | :heavy_check_mark: | Operation performed | all | +| `data` | List\<[ExpenseReport](../../models/components/ExpenseReport.md)> | :heavy_check_mark: | N/A | | +| `meta` | [Optional\](../../models/components/Meta.md) | :heavy_minus_sign: | Response metadata | | +| `links` | [Optional\](../../models/components/Links.md) | :heavy_minus_sign: | Links to navigate to previous or next pages through the API | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/components/LinkedSubsidiary.md b/docs/models/components/LinkedSubsidiary.md new file mode 100644 index 000000000..0074f8b73 --- /dev/null +++ b/docs/models/components/LinkedSubsidiary.md @@ -0,0 +1,10 @@ +# LinkedSubsidiary + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `id` | *Optional\* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | +| `displayId` | *JsonNullable\* | :heavy_minus_sign: | Id to be displayed. | 123456 | +| `name` | *JsonNullable\* | :heavy_minus_sign: | The name of the resource. | Acme Inc. | \ No newline at end of file diff --git a/docs/models/components/LinkedSubsidiaryInput.md b/docs/models/components/LinkedSubsidiaryInput.md new file mode 100644 index 000000000..cdf5d0543 --- /dev/null +++ b/docs/models/components/LinkedSubsidiaryInput.md @@ -0,0 +1,9 @@ +# LinkedSubsidiaryInput + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `displayId` | *JsonNullable\* | :heavy_minus_sign: | Id to be displayed. | 123456 | +| `name` | *JsonNullable\* | :heavy_minus_sign: | The name of the resource. | Acme Inc. | \ No newline at end of file diff --git a/docs/models/components/UpdateAccountingEmployeeResponse.md b/docs/models/components/UpdateAccountingEmployeeResponse.md new file mode 100644 index 000000000..fcb914935 --- /dev/null +++ b/docs/models/components/UpdateAccountingEmployeeResponse.md @@ -0,0 +1,16 @@ +# UpdateAccountingEmployeeResponse + +Employees + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | quickbooks | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | Employees | +| `operation` | *String* | :heavy_check_mark: | Operation performed | update | +| `data` | [UnifiedId](../../models/components/UnifiedId.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/components/UpdateExpenseCategoryResponse.md b/docs/models/components/UpdateExpenseCategoryResponse.md new file mode 100644 index 000000000..580e1ed1a --- /dev/null +++ b/docs/models/components/UpdateExpenseCategoryResponse.md @@ -0,0 +1,16 @@ +# UpdateExpenseCategoryResponse + +Expense Categories + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | netsuite | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | ExpenseCategories | +| `operation` | *String* | :heavy_check_mark: | Operation performed | update | +| `data` | [UnifiedId](../../models/components/UnifiedId.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/components/UpdateExpenseReportResponse.md b/docs/models/components/UpdateExpenseReportResponse.md new file mode 100644 index 000000000..c24a20b49 --- /dev/null +++ b/docs/models/components/UpdateExpenseReportResponse.md @@ -0,0 +1,16 @@ +# UpdateExpenseReportResponse + +Expense Reports + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `statusCode` | *long* | :heavy_check_mark: | HTTP Response Status Code | 200 | +| `status` | *String* | :heavy_check_mark: | HTTP Response Status | OK | +| `service` | *String* | :heavy_check_mark: | Apideck ID of service provider | netsuite | +| `resource` | *String* | :heavy_check_mark: | Unified API resource name | ExpenseReports | +| `operation` | *String* | :heavy_check_mark: | Operation performed | update | +| `data` | [UnifiedId](../../models/components/UnifiedId.md) | :heavy_check_mark: | A object containing a unique identifier for the resource that was created, updated, or deleted. | | +| `raw` | Map\ | :heavy_minus_sign: | Raw response from the integration when raw=true query param is provided | | \ No newline at end of file diff --git a/docs/models/operations/AccountingEmployeesAddRequest.md b/docs/models/operations/AccountingEmployeesAddRequest.md new file mode 100644 index 000000000..c127db47b --- /dev/null +++ b/docs/models/operations/AccountingEmployeesAddRequest.md @@ -0,0 +1,12 @@ +# AccountingEmployeesAddRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `accountingEmployee` | [AccountingEmployeeInput](../../models/components/AccountingEmployeeInput.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/AccountingEmployeesAddResponse.md b/docs/models/operations/AccountingEmployeesAddResponse.md new file mode 100644 index 000000000..2d7b8c531 --- /dev/null +++ b/docs/models/operations/AccountingEmployeesAddResponse.md @@ -0,0 +1,12 @@ +# AccountingEmployeesAddResponse + + +## 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 | +| `createAccountingEmployeeResponse` | [Optional\](../../models/components/CreateAccountingEmployeeResponse.md) | :heavy_minus_sign: | Employees | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/AccountingEmployeesAllRequest.md b/docs/models/operations/AccountingEmployeesAllRequest.md new file mode 100644 index 000000000..54096d4a1 --- /dev/null +++ b/docs/models/operations/AccountingEmployeesAllRequest.md @@ -0,0 +1,15 @@ +# AccountingEmployeesAllRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `cursor` | *JsonNullable\* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional\* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `fields` | *JsonNullable\* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `filter` | [Optional\](../../models/components/AccountingEmployeesFilter.md) | :heavy_minus_sign: | Apply filters | {
"updated_since": "2020-09-30T07:43:32.000Z",
"status": "active"
} | \ No newline at end of file diff --git a/docs/models/operations/AccountingEmployeesAllResponse.md b/docs/models/operations/AccountingEmployeesAllResponse.md new file mode 100644 index 000000000..bce24c589 --- /dev/null +++ b/docs/models/operations/AccountingEmployeesAllResponse.md @@ -0,0 +1,12 @@ +# AccountingEmployeesAllResponse + + +## 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 | +| `getAccountingEmployeesResponse` | [Optional\](../../models/components/GetAccountingEmployeesResponse.md) | :heavy_minus_sign: | Employees | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/AccountingEmployeesDeleteRequest.md b/docs/models/operations/AccountingEmployeesDeleteRequest.md new file mode 100644 index 000000000..abb05fe0c --- /dev/null +++ b/docs/models/operations/AccountingEmployeesDeleteRequest.md @@ -0,0 +1,12 @@ +# AccountingEmployeesDeleteRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | \ No newline at end of file diff --git a/docs/models/operations/AccountingEmployeesDeleteResponse.md b/docs/models/operations/AccountingEmployeesDeleteResponse.md new file mode 100644 index 000000000..2cbe009a4 --- /dev/null +++ b/docs/models/operations/AccountingEmployeesDeleteResponse.md @@ -0,0 +1,12 @@ +# AccountingEmployeesDeleteResponse + + +## 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 | +| `deleteAccountingEmployeeResponse` | [Optional\](../../models/components/DeleteAccountingEmployeeResponse.md) | :heavy_minus_sign: | Employees | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/AccountingEmployeesOneRequest.md b/docs/models/operations/AccountingEmployeesOneRequest.md new file mode 100644 index 000000000..1405f7d60 --- /dev/null +++ b/docs/models/operations/AccountingEmployeesOneRequest.md @@ -0,0 +1,13 @@ +# AccountingEmployeesOneRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `fields` | *JsonNullable\* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | \ No newline at end of file diff --git a/docs/models/operations/AccountingEmployeesOneResponse.md b/docs/models/operations/AccountingEmployeesOneResponse.md new file mode 100644 index 000000000..7c046168e --- /dev/null +++ b/docs/models/operations/AccountingEmployeesOneResponse.md @@ -0,0 +1,12 @@ +# AccountingEmployeesOneResponse + + +## 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 | +| `getAccountingEmployeeResponse` | [Optional\](../../models/components/GetAccountingEmployeeResponse.md) | :heavy_minus_sign: | Employees | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/AccountingEmployeesUpdateRequest.md b/docs/models/operations/AccountingEmployeesUpdateRequest.md new file mode 100644 index 000000000..8269c0fda --- /dev/null +++ b/docs/models/operations/AccountingEmployeesUpdateRequest.md @@ -0,0 +1,13 @@ +# AccountingEmployeesUpdateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `accountingEmployee` | [AccountingEmployeeInput](../../models/components/AccountingEmployeeInput.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/AccountingEmployeesUpdateResponse.md b/docs/models/operations/AccountingEmployeesUpdateResponse.md new file mode 100644 index 000000000..dd3b15d85 --- /dev/null +++ b/docs/models/operations/AccountingEmployeesUpdateResponse.md @@ -0,0 +1,12 @@ +# AccountingEmployeesUpdateResponse + + +## 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 | +| `updateAccountingEmployeeResponse` | [Optional\](../../models/components/UpdateAccountingEmployeeResponse.md) | :heavy_minus_sign: | Employees | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseCategoriesAddRequest.md b/docs/models/operations/AccountingExpenseCategoriesAddRequest.md new file mode 100644 index 000000000..b6fb9355c --- /dev/null +++ b/docs/models/operations/AccountingExpenseCategoriesAddRequest.md @@ -0,0 +1,12 @@ +# AccountingExpenseCategoriesAddRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `expenseCategory` | [ExpenseCategoryInput](../../models/components/ExpenseCategoryInput.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseCategoriesAddResponse.md b/docs/models/operations/AccountingExpenseCategoriesAddResponse.md new file mode 100644 index 000000000..06fa93d63 --- /dev/null +++ b/docs/models/operations/AccountingExpenseCategoriesAddResponse.md @@ -0,0 +1,12 @@ +# AccountingExpenseCategoriesAddResponse + + +## 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 | +| `createExpenseCategoryResponse` | [Optional\](../../models/components/CreateExpenseCategoryResponse.md) | :heavy_minus_sign: | Expense Categories | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseCategoriesAllRequest.md b/docs/models/operations/AccountingExpenseCategoriesAllRequest.md new file mode 100644 index 000000000..175511e49 --- /dev/null +++ b/docs/models/operations/AccountingExpenseCategoriesAllRequest.md @@ -0,0 +1,15 @@ +# AccountingExpenseCategoriesAllRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `cursor` | *JsonNullable\* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional\* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `fields` | *JsonNullable\* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `filter` | [Optional\](../../models/components/ExpenseCategoriesFilter.md) | :heavy_minus_sign: | Apply filters | {
"updated_since": "2020-09-30T07:43:32.000Z",
"status": "active"
} | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseCategoriesAllResponse.md b/docs/models/operations/AccountingExpenseCategoriesAllResponse.md new file mode 100644 index 000000000..437ce369a --- /dev/null +++ b/docs/models/operations/AccountingExpenseCategoriesAllResponse.md @@ -0,0 +1,12 @@ +# AccountingExpenseCategoriesAllResponse + + +## 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 | +| `getExpenseCategoriesResponse` | [Optional\](../../models/components/GetExpenseCategoriesResponse.md) | :heavy_minus_sign: | Expense Categories | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseCategoriesDeleteRequest.md b/docs/models/operations/AccountingExpenseCategoriesDeleteRequest.md new file mode 100644 index 000000000..be8345ed2 --- /dev/null +++ b/docs/models/operations/AccountingExpenseCategoriesDeleteRequest.md @@ -0,0 +1,12 @@ +# AccountingExpenseCategoriesDeleteRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseCategoriesDeleteResponse.md b/docs/models/operations/AccountingExpenseCategoriesDeleteResponse.md new file mode 100644 index 000000000..d9f243bdc --- /dev/null +++ b/docs/models/operations/AccountingExpenseCategoriesDeleteResponse.md @@ -0,0 +1,12 @@ +# AccountingExpenseCategoriesDeleteResponse + + +## 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 | +| `deleteExpenseCategoryResponse` | [Optional\](../../models/components/DeleteExpenseCategoryResponse.md) | :heavy_minus_sign: | Expense Categories | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseCategoriesOneRequest.md b/docs/models/operations/AccountingExpenseCategoriesOneRequest.md new file mode 100644 index 000000000..d442e4433 --- /dev/null +++ b/docs/models/operations/AccountingExpenseCategoriesOneRequest.md @@ -0,0 +1,13 @@ +# AccountingExpenseCategoriesOneRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `fields` | *JsonNullable\* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseCategoriesOneResponse.md b/docs/models/operations/AccountingExpenseCategoriesOneResponse.md new file mode 100644 index 000000000..817c55f6d --- /dev/null +++ b/docs/models/operations/AccountingExpenseCategoriesOneResponse.md @@ -0,0 +1,12 @@ +# AccountingExpenseCategoriesOneResponse + + +## 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 | +| `getExpenseCategoryResponse` | [Optional\](../../models/components/GetExpenseCategoryResponse.md) | :heavy_minus_sign: | Expense Categories | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseCategoriesUpdateRequest.md b/docs/models/operations/AccountingExpenseCategoriesUpdateRequest.md new file mode 100644 index 000000000..6333d5a1a --- /dev/null +++ b/docs/models/operations/AccountingExpenseCategoriesUpdateRequest.md @@ -0,0 +1,13 @@ +# AccountingExpenseCategoriesUpdateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `expenseCategory` | [ExpenseCategoryInput](../../models/components/ExpenseCategoryInput.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseCategoriesUpdateResponse.md b/docs/models/operations/AccountingExpenseCategoriesUpdateResponse.md new file mode 100644 index 000000000..838e950ce --- /dev/null +++ b/docs/models/operations/AccountingExpenseCategoriesUpdateResponse.md @@ -0,0 +1,12 @@ +# AccountingExpenseCategoriesUpdateResponse + + +## 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 | +| `updateExpenseCategoryResponse` | [Optional\](../../models/components/UpdateExpenseCategoryResponse.md) | :heavy_minus_sign: | Expense Categories | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseReportsAddRequest.md b/docs/models/operations/AccountingExpenseReportsAddRequest.md new file mode 100644 index 000000000..d78d97db6 --- /dev/null +++ b/docs/models/operations/AccountingExpenseReportsAddRequest.md @@ -0,0 +1,12 @@ +# AccountingExpenseReportsAddRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `expenseReport` | [ExpenseReportInput](../../models/components/ExpenseReportInput.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseReportsAddResponse.md b/docs/models/operations/AccountingExpenseReportsAddResponse.md new file mode 100644 index 000000000..9417a2c6e --- /dev/null +++ b/docs/models/operations/AccountingExpenseReportsAddResponse.md @@ -0,0 +1,12 @@ +# AccountingExpenseReportsAddResponse + + +## 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 | +| `createExpenseReportResponse` | [Optional\](../../models/components/CreateExpenseReportResponse.md) | :heavy_minus_sign: | Expense Reports | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseReportsAllRequest.md b/docs/models/operations/AccountingExpenseReportsAllRequest.md new file mode 100644 index 000000000..27d1fbba5 --- /dev/null +++ b/docs/models/operations/AccountingExpenseReportsAllRequest.md @@ -0,0 +1,15 @@ +# AccountingExpenseReportsAllRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `cursor` | *JsonNullable\* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | +| `limit` | *Optional\* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | +| `fields` | *JsonNullable\* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `filter` | [Optional\](../../models/components/ExpenseReportsFilter.md) | :heavy_minus_sign: | Apply filters | {
"updated_since": "2020-09-30T07:43:32.000Z",
"status": "submitted"
} | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseReportsAllResponse.md b/docs/models/operations/AccountingExpenseReportsAllResponse.md new file mode 100644 index 000000000..b939048f0 --- /dev/null +++ b/docs/models/operations/AccountingExpenseReportsAllResponse.md @@ -0,0 +1,12 @@ +# AccountingExpenseReportsAllResponse + + +## 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 | +| `getExpenseReportsResponse` | [Optional\](../../models/components/GetExpenseReportsResponse.md) | :heavy_minus_sign: | Expense Reports | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseReportsDeleteRequest.md b/docs/models/operations/AccountingExpenseReportsDeleteRequest.md new file mode 100644 index 000000000..bd1df3391 --- /dev/null +++ b/docs/models/operations/AccountingExpenseReportsDeleteRequest.md @@ -0,0 +1,12 @@ +# AccountingExpenseReportsDeleteRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseReportsDeleteResponse.md b/docs/models/operations/AccountingExpenseReportsDeleteResponse.md new file mode 100644 index 000000000..b8ebf9535 --- /dev/null +++ b/docs/models/operations/AccountingExpenseReportsDeleteResponse.md @@ -0,0 +1,12 @@ +# AccountingExpenseReportsDeleteResponse + + +## 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 | +| `deleteExpenseReportResponse` | [Optional\](../../models/components/DeleteExpenseReportResponse.md) | :heavy_minus_sign: | Expense Reports | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseReportsOneRequest.md b/docs/models/operations/AccountingExpenseReportsOneRequest.md new file mode 100644 index 000000000..d62652aaf --- /dev/null +++ b/docs/models/operations/AccountingExpenseReportsOneRequest.md @@ -0,0 +1,13 @@ +# AccountingExpenseReportsOneRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `fields` | *JsonNullable\* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseReportsOneResponse.md b/docs/models/operations/AccountingExpenseReportsOneResponse.md new file mode 100644 index 000000000..2f0cbc59b --- /dev/null +++ b/docs/models/operations/AccountingExpenseReportsOneResponse.md @@ -0,0 +1,12 @@ +# AccountingExpenseReportsOneResponse + + +## 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 | +| `getExpenseReportResponse` | [Optional\](../../models/components/GetExpenseReportResponse.md) | :heavy_minus_sign: | Expense Reports | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseReportsUpdateRequest.md b/docs/models/operations/AccountingExpenseReportsUpdateRequest.md new file mode 100644 index 000000000..270a60957 --- /dev/null +++ b/docs/models/operations/AccountingExpenseReportsUpdateRequest.md @@ -0,0 +1,13 @@ +# AccountingExpenseReportsUpdateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *String* | :heavy_check_mark: | ID of the record you are acting upon. | | +| `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | +| `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | +| `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | +| `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | +| `expenseReport` | [ExpenseReportInput](../../models/components/ExpenseReportInput.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/AccountingExpenseReportsUpdateResponse.md b/docs/models/operations/AccountingExpenseReportsUpdateResponse.md new file mode 100644 index 000000000..e2fa99377 --- /dev/null +++ b/docs/models/operations/AccountingExpenseReportsUpdateResponse.md @@ -0,0 +1,12 @@ +# AccountingExpenseReportsUpdateResponse + + +## 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 | +| `updateExpenseReportResponse` | [Optional\](../../models/components/UpdateExpenseReportResponse.md) | :heavy_minus_sign: | Expense Reports | +| `unexpectedErrorResponse` | [Optional\](../../models/components/UnexpectedErrorResponse.md) | :heavy_minus_sign: | Unexpected error | \ No newline at end of file diff --git a/docs/sdks/apideckemployees/README.md b/docs/sdks/apideckemployees/README.md new file mode 100644 index 000000000..b65b2b66b --- /dev/null +++ b/docs/sdks/apideckemployees/README.md @@ -0,0 +1,988 @@ +# Hris.Employees + +## Overview + +### Available Operations + +* [list](#list) - List Employees +* [create](#create) - Create Employee +* [get](#get) - Get Employee +* [update](#update) - Update Employee +* [delete](#delete) - Delete Employee + +## list + +Apideck operates as a stateless Unified API, which means that the list endpoint only provides a portion of the employee model. This is due to the fact that most HRIS systems do not readily provide all data in every call. However, you can access the complete employee model through an employee detail call. + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.components.*; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.HrisEmployeesAllRequest; +import com.apideck.unify.models.operations.HrisEmployeesAllResponse; +import java.lang.Exception; +import java.util.Map; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + HrisEmployeesAllRequest req = HrisEmployeesAllRequest.builder() + .serviceId("salesforce") + .filter(EmployeesFilter.builder() + .companyId("1234") + .email("elon@tesla.com") + .firstName("Elon") + .title("Manager") + .lastName("Musk") + .managerId("1234") + .employmentStatus(EmployeesFilterEmploymentStatus.ACTIVE) + .employeeNumber("123456-AB") + .departmentId("1234") + .city("San Francisco") + .country("US") + .build()) + .sort(EmployeesSort.builder() + .by(EmployeesSortBy.CREATED_AT) + .direction(SortDirection.DESC) + .build()) + .passThrough(Map.ofEntries( + Map.entry("search", "San Francisco"))) + .fields("id,updated_at") + .build(); + + + sdk.hris().employees().list() + .callAsStream() + .forEach((HrisEmployeesAllResponse item) -> { + // handle page + }); + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `request` | [HrisEmployeesAllRequest](../../models/operations/HrisEmployeesAllRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[HrisEmployeesAllResponse](../../models/operations/HrisEmployeesAllResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## create + +Create Employee + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.components.*; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.HrisEmployeesAddRequest; +import com.apideck.unify.models.operations.HrisEmployeesAddResponse; +import java.lang.Exception; +import java.time.LocalDate; +import java.util.List; +import java.util.Map; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + HrisEmployeesAddRequest req = HrisEmployeesAddRequest.builder() + .employee(EmployeeInput.builder() + .id("12345") + .firstName("Elon") + .lastName("Musk") + .middleName("D.") + .displayName("Technoking") + .preferredName("Elon Musk") + .initials("EM") + .salutation("Mr") + .title("CEO") + .maritalStatus("married") + .partner(PersonInput.builder() + .firstName("Elon") + .lastName("Musk") + .middleName("D.") + .gender(Gender.MALE) + .initials("EM") + .birthday(LocalDate.parse("2000-08-12")) + .deceasedOn(LocalDate.parse("2000-08-12")) + .build()) + .division("Europe") + .divisionId("12345") + .departmentId("12345") + .departmentName("12345") + .team(Team.builder() + .id("1234") + .name("Full Stack Engineers") + .build()) + .companyId("23456") + .companyName("SpaceX") + .employmentStartDate("2021-10-26") + .employmentEndDate("2028-10-26") + .leavingReason(LeavingReason.RESIGNED) + .employeeNumber("123456-AB") + .employmentStatus(EmploymentStatus.ACTIVE) + .ethnicity("African American") + .manager(Manager.builder() + .id("12345") + .name("Elon Musk") + .firstName("Elon") + .lastName("Musk") + .email("elon@musk.com") + .employmentStatus(EmploymentStatus.ACTIVE) + .build()) + .directReports(List.of( + "a0d636c6-43b3-4bde-8c70-85b707d992f4", + "a98lfd96-43b3-4bde-8c70-85b707d992e6")) + .socialSecurityNumber("123456789") + .birthday(LocalDate.parse("2000-08-12")) + .deceasedOn(LocalDate.parse("2000-08-12")) + .countryOfBirth("US") + .description("A description") + .gender(Gender.MALE) + .pronouns("she,her") + .preferredLanguage("EN") + .languages(List.of( + "EN")) + .nationalities(List.of( + "US")) + .photoUrl("https://unavatar.io/elon-musk") + .timezone("Europe/London") + .source("lever") + .sourceId("12345") + .recordUrl("https://app.intercom.io/contacts/12345") + .jobs(List.of( + EmployeeJobInput.builder() + .title("CEO") + .role("Sales") + .startDate(LocalDate.parse("2020-08-12")) + .endDate(LocalDate.parse("2020-08-12")) + .compensationRate(72000d) + .currency(Currency.USD) + .paymentUnit(PaymentUnit.YEAR) + .hiredAt(LocalDate.parse("2020-08-12")) + .isPrimary(true) + .isManager(true) + .status(EmployeeJobStatus.ACTIVE) + .location(Address.builder() + .id("123") + .type(Type.PRIMARY) + .string("25 Spring Street, Blackburn, VIC 3130") + .name("HQ US") + .line1("Main street") + .line2("apt #") + .line3("Suite #") + .line4("delivery instructions") + .streetNumber("25") + .city("San Francisco") + .state("CA") + .postalCode("94104") + .country("US") + .latitude("40.759211") + .longitude("-73.984638") + .county("Santa Clara") + .contactName("Elon Musk") + .salutation("Mr") + .phoneNumber("111-111-1111") + .fax("122-111-1111") + .email("elon@musk.com") + .website("https://elonmusk.com") + .notes("Address notes or delivery instructions.") + .rowVersion("1-12345") + .build()) + .build(), + EmployeeJobInput.builder() + .title("CEO") + .role("Sales") + .startDate(LocalDate.parse("2020-08-12")) + .endDate(LocalDate.parse("2020-08-12")) + .compensationRate(72000d) + .currency(Currency.USD) + .paymentUnit(PaymentUnit.YEAR) + .hiredAt(LocalDate.parse("2020-08-12")) + .isPrimary(true) + .isManager(true) + .status(EmployeeJobStatus.ACTIVE) + .location(Address.builder() + .id("123") + .type(Type.PRIMARY) + .string("25 Spring Street, Blackburn, VIC 3130") + .name("HQ US") + .line1("Main street") + .line2("apt #") + .line3("Suite #") + .line4("delivery instructions") + .streetNumber("25") + .city("San Francisco") + .state("CA") + .postalCode("94104") + .country("US") + .latitude("40.759211") + .longitude("-73.984638") + .county("Santa Clara") + .contactName("Elon Musk") + .salutation("Mr") + .phoneNumber("111-111-1111") + .fax("122-111-1111") + .email("elon@musk.com") + .website("https://elonmusk.com") + .notes("Address notes or delivery instructions.") + .rowVersion("1-12345") + .build()) + .build(), + EmployeeJobInput.builder() + .title("CEO") + .role("Sales") + .startDate(LocalDate.parse("2020-08-12")) + .endDate(LocalDate.parse("2020-08-12")) + .compensationRate(72000d) + .currency(Currency.USD) + .paymentUnit(PaymentUnit.YEAR) + .hiredAt(LocalDate.parse("2020-08-12")) + .isPrimary(true) + .isManager(true) + .status(EmployeeJobStatus.ACTIVE) + .location(Address.builder() + .id("123") + .type(Type.PRIMARY) + .string("25 Spring Street, Blackburn, VIC 3130") + .name("HQ US") + .line1("Main street") + .line2("apt #") + .line3("Suite #") + .line4("delivery instructions") + .streetNumber("25") + .city("San Francisco") + .state("CA") + .postalCode("94104") + .country("US") + .latitude("40.759211") + .longitude("-73.984638") + .county("Santa Clara") + .contactName("Elon Musk") + .salutation("Mr") + .phoneNumber("111-111-1111") + .fax("122-111-1111") + .email("elon@musk.com") + .website("https://elonmusk.com") + .notes("Address notes or delivery instructions.") + .rowVersion("1-12345") + .build()) + .build())) + .compensations(List.of( + EmployeeCompensationInput.builder() + .rate(50d) + .paymentUnit(PaymentUnit.HOUR) + .flsaStatus(FlsaStatus.NONEXEMPT) + .effectiveDate("2021-06-11") + .build())) + .worksRemote(true) + .addresses(List.of( + Address.builder() + .id("123") + .type(Type.PRIMARY) + .string("25 Spring Street, Blackburn, VIC 3130") + .name("HQ US") + .line1("Main street") + .line2("apt #") + .line3("Suite #") + .line4("delivery instructions") + .streetNumber("25") + .city("San Francisco") + .state("CA") + .postalCode("94104") + .country("US") + .latitude("40.759211") + .longitude("-73.984638") + .county("Santa Clara") + .contactName("Elon Musk") + .salutation("Mr") + .phoneNumber("111-111-1111") + .fax("122-111-1111") + .email("elon@musk.com") + .website("https://elonmusk.com") + .notes("Address notes or delivery instructions.") + .rowVersion("1-12345") + .build(), + Address.builder() + .id("123") + .type(Type.PRIMARY) + .string("25 Spring Street, Blackburn, VIC 3130") + .name("HQ US") + .line1("Main street") + .line2("apt #") + .line3("Suite #") + .line4("delivery instructions") + .streetNumber("25") + .city("San Francisco") + .state("CA") + .postalCode("94104") + .country("US") + .latitude("40.759211") + .longitude("-73.984638") + .county("Santa Clara") + .contactName("Elon Musk") + .salutation("Mr") + .phoneNumber("111-111-1111") + .fax("122-111-1111") + .email("elon@musk.com") + .website("https://elonmusk.com") + .notes("Address notes or delivery instructions.") + .rowVersion("1-12345") + .build())) + .phoneNumbers(List.of( + PhoneNumber.builder() + .number("111-111-1111") + .id("12345") + .countryCode("1") + .areaCode("323") + .extension("105") + .type(PhoneNumberType.PRIMARY) + .build())) + .emails(List.of( + Email.builder() + .email("elon@musk.com") + .id("123") + .type(EmailType.PRIMARY) + .build())) + .customFields(List.of( + CustomField.of(CustomField1.builder() + .id("2389328923893298") + .name("employee_level") + .description("Employee Level") + .value(CustomField1Value.of("Uses Salesforce and Marketo")) + .build()), + CustomField.of(CustomField1.builder() + .id("2389328923893298") + .name("employee_level") + .description("Employee Level") + .value(CustomField1Value.of("Uses Salesforce and Marketo")) + .build()))) + .socialLinks(List.of( + SocialLink.builder() + .url("https://www.twitter.com/apideck") + .id("12345") + .type("twitter") + .build(), + SocialLink.builder() + .url("https://www.twitter.com/apideck") + .id("12345") + .type("twitter") + .build())) + .bankAccounts(List.of( + BankAccount2.builder() + .bankName("Monzo") + .accountNumber("123465") + .accountName("SPACEX LLC") + .accountType(BankAccount2AccountType.CREDIT_CARD) + .iban("CH2989144532982975332") + .bic("AUDSCHGGXXX") + .routingNumber("012345678") + .bsbNumber("062-001") + .branchIdentifier("001") + .bankCode("BNH") + .currency(Currency.USD) + .build(), + BankAccount2.builder() + .bankName("Monzo") + .accountNumber("123465") + .accountName("SPACEX LLC") + .accountType(BankAccount2AccountType.CREDIT_CARD) + .iban("CH2989144532982975332") + .bic("AUDSCHGGXXX") + .routingNumber("012345678") + .bsbNumber("062-001") + .branchIdentifier("001") + .bankCode("BNH") + .currency(Currency.USD) + .build(), + BankAccount2.builder() + .bankName("Monzo") + .accountNumber("123465") + .accountName("SPACEX LLC") + .accountType(BankAccount2AccountType.CREDIT_CARD) + .iban("CH2989144532982975332") + .bic("AUDSCHGGXXX") + .routingNumber("012345678") + .bsbNumber("062-001") + .branchIdentifier("001") + .bankCode("BNH") + .currency(Currency.USD) + .build())) + .taxCode("1111") + .taxId("234-32-0000") + .dietaryPreference("Veggie") + .foodAllergies(List.of( + "No allergies")) + .probationPeriod(ProbationPeriod.builder() + .startDate(LocalDate.parse("2021-10-01")) + .endDate(LocalDate.parse("2021-11-28")) + .build()) + .tags(List.of( + "New")) + .rowVersion("1-12345") + .deleted(true) + .passThrough(List.of( + PassThroughBody.builder() + .serviceId("") + .extendPaths(List.of( + ExtendPaths.builder() + .path("$.nested.property") + .value(Map.ofEntries( + Map.entry("TaxClassificationRef", Map.ofEntries( + Map.entry("value", "EUC-99990201-V1-00020000"))))) + .build(), + ExtendPaths.builder() + .path("$.nested.property") + .value(Map.ofEntries( + Map.entry("TaxClassificationRef", Map.ofEntries( + Map.entry("value", "EUC-99990201-V1-00020000"))))) + .build())) + .build(), + PassThroughBody.builder() + .serviceId("") + .extendPaths(List.of( + ExtendPaths.builder() + .path("$.nested.property") + .value(Map.ofEntries( + Map.entry("TaxClassificationRef", Map.ofEntries( + Map.entry("value", "EUC-99990201-V1-00020000"))))) + .build(), + ExtendPaths.builder() + .path("$.nested.property") + .value(Map.ofEntries( + Map.entry("TaxClassificationRef", Map.ofEntries( + Map.entry("value", "EUC-99990201-V1-00020000"))))) + .build())) + .build(), + PassThroughBody.builder() + .serviceId("") + .extendPaths(List.of( + ExtendPaths.builder() + .path("$.nested.property") + .value(Map.ofEntries( + Map.entry("TaxClassificationRef", Map.ofEntries( + Map.entry("value", "EUC-99990201-V1-00020000"))))) + .build(), + ExtendPaths.builder() + .path("$.nested.property") + .value(Map.ofEntries( + Map.entry("TaxClassificationRef", Map.ofEntries( + Map.entry("value", "EUC-99990201-V1-00020000"))))) + .build())) + .build())) + .build()) + .serviceId("salesforce") + .build(); + + HrisEmployeesAddResponse res = sdk.hris().employees().create() + .request(req) + .call(); + + if (res.createEmployeeResponse().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `request` | [HrisEmployeesAddRequest](../../models/operations/HrisEmployeesAddRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[HrisEmployeesAddResponse](../../models/operations/HrisEmployeesAddResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## get + +Get Employee + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.components.EmployeesOneFilter; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.HrisEmployeesOneRequest; +import com.apideck.unify.models.operations.HrisEmployeesOneResponse; +import java.lang.Exception; +import java.util.Map; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + HrisEmployeesOneRequest req = HrisEmployeesOneRequest.builder() + .id("") + .serviceId("salesforce") + .fields("id,updated_at") + .filter(EmployeesOneFilter.builder() + .companyId("1234") + .build()) + .passThrough(Map.ofEntries( + Map.entry("search", "San Francisco"))) + .build(); + + HrisEmployeesOneResponse res = sdk.hris().employees().get() + .request(req) + .call(); + + if (res.getEmployeeResponse().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `request` | [HrisEmployeesOneRequest](../../models/operations/HrisEmployeesOneRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[HrisEmployeesOneResponse](../../models/operations/HrisEmployeesOneResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## update + +Update Employee + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.components.*; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.HrisEmployeesUpdateRequest; +import com.apideck.unify.models.operations.HrisEmployeesUpdateResponse; +import java.lang.Exception; +import java.time.LocalDate; +import java.util.List; +import java.util.Map; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + HrisEmployeesUpdateRequest req = HrisEmployeesUpdateRequest.builder() + .id("") + .employee(EmployeeInput.builder() + .id("12345") + .firstName("Elon") + .lastName("Musk") + .middleName("D.") + .displayName("Technoking") + .preferredName("Elon Musk") + .initials("EM") + .salutation("Mr") + .title("CEO") + .maritalStatus("married") + .partner(PersonInput.builder() + .firstName("Elon") + .lastName("Musk") + .middleName("D.") + .gender(Gender.MALE) + .initials("EM") + .birthday(LocalDate.parse("2000-08-12")) + .deceasedOn(LocalDate.parse("2000-08-12")) + .build()) + .division("Europe") + .divisionId("12345") + .departmentId("12345") + .departmentName("12345") + .team(Team.builder() + .id("1234") + .name("Full Stack Engineers") + .build()) + .companyId("23456") + .companyName("SpaceX") + .employmentStartDate("2021-10-26") + .employmentEndDate("2028-10-26") + .leavingReason(LeavingReason.RESIGNED) + .employeeNumber("123456-AB") + .employmentStatus(EmploymentStatus.ACTIVE) + .ethnicity("African American") + .manager(Manager.builder() + .id("12345") + .name("Elon Musk") + .firstName("Elon") + .lastName("Musk") + .email("elon@musk.com") + .employmentStatus(EmploymentStatus.ACTIVE) + .build()) + .directReports(List.of( + "a0d636c6-43b3-4bde-8c70-85b707d992f4", + "a98lfd96-43b3-4bde-8c70-85b707d992e6")) + .socialSecurityNumber("123456789") + .birthday(LocalDate.parse("2000-08-12")) + .deceasedOn(LocalDate.parse("2000-08-12")) + .countryOfBirth("US") + .description("A description") + .gender(Gender.MALE) + .pronouns("she,her") + .preferredLanguage("EN") + .languages(List.of( + "EN")) + .nationalities(List.of( + "US")) + .photoUrl("https://unavatar.io/elon-musk") + .timezone("Europe/London") + .source("lever") + .sourceId("12345") + .recordUrl("https://app.intercom.io/contacts/12345") + .jobs(List.of( + EmployeeJobInput.builder() + .title("CEO") + .role("Sales") + .startDate(LocalDate.parse("2020-08-12")) + .endDate(LocalDate.parse("2020-08-12")) + .compensationRate(72000d) + .currency(Currency.USD) + .paymentUnit(PaymentUnit.YEAR) + .hiredAt(LocalDate.parse("2020-08-12")) + .isPrimary(true) + .isManager(true) + .status(EmployeeJobStatus.ACTIVE) + .location(Address.builder() + .id("123") + .type(Type.PRIMARY) + .string("25 Spring Street, Blackburn, VIC 3130") + .name("HQ US") + .line1("Main street") + .line2("apt #") + .line3("Suite #") + .line4("delivery instructions") + .streetNumber("25") + .city("San Francisco") + .state("CA") + .postalCode("94104") + .country("US") + .latitude("40.759211") + .longitude("-73.984638") + .county("Santa Clara") + .contactName("Elon Musk") + .salutation("Mr") + .phoneNumber("111-111-1111") + .fax("122-111-1111") + .email("elon@musk.com") + .website("https://elonmusk.com") + .notes("Address notes or delivery instructions.") + .rowVersion("1-12345") + .build()) + .build())) + .compensations(List.of( + EmployeeCompensationInput.builder() + .rate(50d) + .paymentUnit(PaymentUnit.HOUR) + .flsaStatus(FlsaStatus.NONEXEMPT) + .effectiveDate("2021-06-11") + .build())) + .worksRemote(true) + .addresses(List.of( + Address.builder() + .id("123") + .type(Type.PRIMARY) + .string("25 Spring Street, Blackburn, VIC 3130") + .name("HQ US") + .line1("Main street") + .line2("apt #") + .line3("Suite #") + .line4("delivery instructions") + .streetNumber("25") + .city("San Francisco") + .state("CA") + .postalCode("94104") + .country("US") + .latitude("40.759211") + .longitude("-73.984638") + .county("Santa Clara") + .contactName("Elon Musk") + .salutation("Mr") + .phoneNumber("111-111-1111") + .fax("122-111-1111") + .email("elon@musk.com") + .website("https://elonmusk.com") + .notes("Address notes or delivery instructions.") + .rowVersion("1-12345") + .build())) + .phoneNumbers(List.of( + PhoneNumber.builder() + .number("111-111-1111") + .id("12345") + .countryCode("1") + .areaCode("323") + .extension("105") + .type(PhoneNumberType.PRIMARY) + .build(), + PhoneNumber.builder() + .number("111-111-1111") + .id("12345") + .countryCode("1") + .areaCode("323") + .extension("105") + .type(PhoneNumberType.PRIMARY) + .build())) + .emails(List.of( + Email.builder() + .email("elon@musk.com") + .id("123") + .type(EmailType.PRIMARY) + .build())) + .customFields(List.of( + CustomField.of(CustomField1.builder() + .id("2389328923893298") + .name("employee_level") + .description("Employee Level") + .value(CustomField1Value.of("Uses Salesforce and Marketo")) + .build()), + CustomField.of(CustomField1.builder() + .id("2389328923893298") + .name("employee_level") + .description("Employee Level") + .value(CustomField1Value.of("Uses Salesforce and Marketo")) + .build()), + CustomField.of(CustomField1.builder() + .id("2389328923893298") + .name("employee_level") + .description("Employee Level") + .value(CustomField1Value.of("Uses Salesforce and Marketo")) + .build()))) + .socialLinks(List.of( + SocialLink.builder() + .url("https://www.twitter.com/apideck") + .id("12345") + .type("twitter") + .build(), + SocialLink.builder() + .url("https://www.twitter.com/apideck") + .id("12345") + .type("twitter") + .build())) + .bankAccounts(List.of( + BankAccount2.builder() + .bankName("Monzo") + .accountNumber("123465") + .accountName("SPACEX LLC") + .accountType(BankAccount2AccountType.CREDIT_CARD) + .iban("CH2989144532982975332") + .bic("AUDSCHGGXXX") + .routingNumber("012345678") + .bsbNumber("062-001") + .branchIdentifier("001") + .bankCode("BNH") + .currency(Currency.USD) + .build())) + .taxCode("1111") + .taxId("234-32-0000") + .dietaryPreference("Veggie") + .foodAllergies(List.of( + "No allergies")) + .probationPeriod(ProbationPeriod.builder() + .startDate(LocalDate.parse("2021-10-01")) + .endDate(LocalDate.parse("2021-11-28")) + .build()) + .tags(List.of( + "New")) + .rowVersion("1-12345") + .deleted(true) + .passThrough(List.of( + PassThroughBody.builder() + .serviceId("") + .extendPaths(List.of( + ExtendPaths.builder() + .path("$.nested.property") + .value(Map.ofEntries( + Map.entry("TaxClassificationRef", Map.ofEntries( + Map.entry("value", "EUC-99990201-V1-00020000"))))) + .build())) + .build(), + PassThroughBody.builder() + .serviceId("") + .extendPaths(List.of( + ExtendPaths.builder() + .path("$.nested.property") + .value(Map.ofEntries( + Map.entry("TaxClassificationRef", Map.ofEntries( + Map.entry("value", "EUC-99990201-V1-00020000"))))) + .build())) + .build())) + .build()) + .serviceId("salesforce") + .build(); + + HrisEmployeesUpdateResponse res = sdk.hris().employees().update() + .request(req) + .call(); + + if (res.updateEmployeeResponse().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `request` | [HrisEmployeesUpdateRequest](../../models/operations/HrisEmployeesUpdateRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[HrisEmployeesUpdateResponse](../../models/operations/HrisEmployeesUpdateResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## delete + +Delete Employee + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.HrisEmployeesDeleteRequest; +import com.apideck.unify.models.operations.HrisEmployeesDeleteResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + HrisEmployeesDeleteRequest req = HrisEmployeesDeleteRequest.builder() + .id("") + .serviceId("salesforce") + .build(); + + HrisEmployeesDeleteResponse res = sdk.hris().employees().delete() + .request(req) + .call(); + + if (res.deleteEmployeeResponse().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `request` | [HrisEmployeesDeleteRequest](../../models/operations/HrisEmployeesDeleteRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[HrisEmployeesDeleteResponse](../../models/operations/HrisEmployeesDeleteResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/employees/README.md b/docs/sdks/employees/README.md index b65b2b66b..d091134e6 100644 --- a/docs/sdks/employees/README.md +++ b/docs/sdks/employees/README.md @@ -1,4 +1,4 @@ -# Hris.Employees +# Accounting.Employees ## Overview @@ -12,21 +12,22 @@ ## list -Apideck operates as a stateless Unified API, which means that the list endpoint only provides a portion of the employee model. This is due to the fact that most HRIS systems do not readily provide all data in every call. However, you can access the complete employee model through an employee detail call. +List Employees ### Example Usage - + ```java package hello.world; import com.apideck.unify.Apideck; -import com.apideck.unify.models.components.*; +import com.apideck.unify.models.components.AccountingEmployeesFilter; +import com.apideck.unify.models.components.AccountingEmployeesFilterStatus; import com.apideck.unify.models.errors.*; -import com.apideck.unify.models.operations.HrisEmployeesAllRequest; -import com.apideck.unify.models.operations.HrisEmployeesAllResponse; +import com.apideck.unify.models.operations.AccountingEmployeesAllRequest; +import com.apideck.unify.models.operations.AccountingEmployeesAllResponse; import java.lang.Exception; -import java.util.Map; +import java.time.OffsetDateTime; public class Application { @@ -38,34 +39,19 @@ public class Application { .apiKey(System.getenv().getOrDefault("API_KEY", "")) .build(); - HrisEmployeesAllRequest req = HrisEmployeesAllRequest.builder() + AccountingEmployeesAllRequest req = AccountingEmployeesAllRequest.builder() .serviceId("salesforce") - .filter(EmployeesFilter.builder() - .companyId("1234") - .email("elon@tesla.com") - .firstName("Elon") - .title("Manager") - .lastName("Musk") - .managerId("1234") - .employmentStatus(EmployeesFilterEmploymentStatus.ACTIVE) - .employeeNumber("123456-AB") - .departmentId("1234") - .city("San Francisco") - .country("US") - .build()) - .sort(EmployeesSort.builder() - .by(EmployeesSortBy.CREATED_AT) - .direction(SortDirection.DESC) - .build()) - .passThrough(Map.ofEntries( - Map.entry("search", "San Francisco"))) .fields("id,updated_at") + .filter(AccountingEmployeesFilter.builder() + .updatedSince(OffsetDateTime.parse("2020-09-30T07:43:32.000Z")) + .status(AccountingEmployeesFilterStatus.ACTIVE) + .build()) .build(); - sdk.hris().employees().list() + sdk.accounting().employees().list() .callAsStream() - .forEach((HrisEmployeesAllResponse item) -> { + .forEach((AccountingEmployeesAllResponse item) -> { // handle page }); @@ -75,13 +61,13 @@ public class Application { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `request` | [HrisEmployeesAllRequest](../../models/operations/HrisEmployeesAllRequest.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `request` | [AccountingEmployeesAllRequest](../../models/operations/AccountingEmployeesAllRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[HrisEmployeesAllResponse](../../models/operations/HrisEmployeesAllResponse.md)** +**[AccountingEmployeesAllResponse](../../models/operations/AccountingEmployeesAllResponse.md)** ### Errors @@ -100,15 +86,15 @@ Create Employee ### Example Usage - + ```java package hello.world; import com.apideck.unify.Apideck; import com.apideck.unify.models.components.*; import com.apideck.unify.models.errors.*; -import com.apideck.unify.models.operations.HrisEmployeesAddRequest; -import com.apideck.unify.models.operations.HrisEmployeesAddResponse; +import com.apideck.unify.models.operations.AccountingEmployeesAddRequest; +import com.apideck.unify.models.operations.AccountingEmployeesAddResponse; import java.lang.Exception; import java.time.LocalDate; import java.util.List; @@ -124,197 +110,53 @@ public class Application { .apiKey(System.getenv().getOrDefault("API_KEY", "")) .build(); - HrisEmployeesAddRequest req = HrisEmployeesAddRequest.builder() - .employee(EmployeeInput.builder() - .id("12345") - .firstName("Elon") - .lastName("Musk") - .middleName("D.") - .displayName("Technoking") - .preferredName("Elon Musk") - .initials("EM") - .salutation("Mr") - .title("CEO") - .maritalStatus("married") - .partner(PersonInput.builder() - .firstName("Elon") - .lastName("Musk") - .middleName("D.") - .gender(Gender.MALE) - .initials("EM") - .birthday(LocalDate.parse("2000-08-12")) - .deceasedOn(LocalDate.parse("2000-08-12")) + AccountingEmployeesAddRequest req = AccountingEmployeesAddRequest.builder() + .accountingEmployee(AccountingEmployeeInput.builder() + .displayId("123456") + .firstName("John") + .lastName("Doe") + .displayName("John Doe") + .emails(List.of( + Email.builder() + .email("elon@musk.com") + .id("123") + .type(EmailType.PRIMARY) + .build())) + .employeeNumber("EMP-001") + .jobTitle("Senior Accountant") + .status(EmployeeStatus.ACTIVE) + .isContractor(false) + .department(LinkedDepartmentInput.builder() + .displayId("123456") + .name("Acme Inc.") .build()) - .division("Europe") - .divisionId("12345") - .departmentId("12345") - .departmentName("12345") - .team(Team.builder() - .id("1234") - .name("Full Stack Engineers") + .location(LinkedLocationInput.builder() + .id("123456") + .displayId("123456") + .name("New York Office") .build()) - .companyId("23456") - .companyName("SpaceX") - .employmentStartDate("2021-10-26") - .employmentEndDate("2028-10-26") - .leavingReason(LeavingReason.RESIGNED) - .employeeNumber("123456-AB") - .employmentStatus(EmploymentStatus.ACTIVE) - .ethnicity("African American") - .manager(Manager.builder() + .manager(AccountingEmployeeManager.builder() .id("12345") - .name("Elon Musk") - .firstName("Elon") - .lastName("Musk") - .email("elon@musk.com") - .employmentStatus(EmploymentStatus.ACTIVE) + .name("Jane Smith") .build()) - .directReports(List.of( - "a0d636c6-43b3-4bde-8c70-85b707d992f4", - "a98lfd96-43b3-4bde-8c70-85b707d992e6")) - .socialSecurityNumber("123456789") - .birthday(LocalDate.parse("2000-08-12")) - .deceasedOn(LocalDate.parse("2000-08-12")) - .countryOfBirth("US") - .description("A description") + .hireDate(LocalDate.parse("2020-01-15")) + .terminationDate(LocalDate.parse("2025-12-31")) .gender(Gender.MALE) - .pronouns("she,her") - .preferredLanguage("EN") - .languages(List.of( - "EN")) - .nationalities(List.of( - "US")) - .photoUrl("https://unavatar.io/elon-musk") - .timezone("Europe/London") - .source("lever") - .sourceId("12345") - .recordUrl("https://app.intercom.io/contacts/12345") - .jobs(List.of( - EmployeeJobInput.builder() - .title("CEO") - .role("Sales") - .startDate(LocalDate.parse("2020-08-12")) - .endDate(LocalDate.parse("2020-08-12")) - .compensationRate(72000d) - .currency(Currency.USD) - .paymentUnit(PaymentUnit.YEAR) - .hiredAt(LocalDate.parse("2020-08-12")) - .isPrimary(true) - .isManager(true) - .status(EmployeeJobStatus.ACTIVE) - .location(Address.builder() - .id("123") - .type(Type.PRIMARY) - .string("25 Spring Street, Blackburn, VIC 3130") - .name("HQ US") - .line1("Main street") - .line2("apt #") - .line3("Suite #") - .line4("delivery instructions") - .streetNumber("25") - .city("San Francisco") - .state("CA") - .postalCode("94104") - .country("US") - .latitude("40.759211") - .longitude("-73.984638") - .county("Santa Clara") - .contactName("Elon Musk") - .salutation("Mr") - .phoneNumber("111-111-1111") - .fax("122-111-1111") - .email("elon@musk.com") - .website("https://elonmusk.com") - .notes("Address notes or delivery instructions.") - .rowVersion("1-12345") - .build()) - .build(), - EmployeeJobInput.builder() - .title("CEO") - .role("Sales") - .startDate(LocalDate.parse("2020-08-12")) - .endDate(LocalDate.parse("2020-08-12")) - .compensationRate(72000d) - .currency(Currency.USD) - .paymentUnit(PaymentUnit.YEAR) - .hiredAt(LocalDate.parse("2020-08-12")) - .isPrimary(true) - .isManager(true) - .status(EmployeeJobStatus.ACTIVE) - .location(Address.builder() - .id("123") - .type(Type.PRIMARY) - .string("25 Spring Street, Blackburn, VIC 3130") - .name("HQ US") - .line1("Main street") - .line2("apt #") - .line3("Suite #") - .line4("delivery instructions") - .streetNumber("25") - .city("San Francisco") - .state("CA") - .postalCode("94104") - .country("US") - .latitude("40.759211") - .longitude("-73.984638") - .county("Santa Clara") - .contactName("Elon Musk") - .salutation("Mr") - .phoneNumber("111-111-1111") - .fax("122-111-1111") - .email("elon@musk.com") - .website("https://elonmusk.com") - .notes("Address notes or delivery instructions.") - .rowVersion("1-12345") - .build()) - .build(), - EmployeeJobInput.builder() - .title("CEO") - .role("Sales") - .startDate(LocalDate.parse("2020-08-12")) - .endDate(LocalDate.parse("2020-08-12")) - .compensationRate(72000d) - .currency(Currency.USD) - .paymentUnit(PaymentUnit.YEAR) - .hiredAt(LocalDate.parse("2020-08-12")) - .isPrimary(true) - .isManager(true) - .status(EmployeeJobStatus.ACTIVE) - .location(Address.builder() - .id("123") - .type(Type.PRIMARY) - .string("25 Spring Street, Blackburn, VIC 3130") - .name("HQ US") - .line1("Main street") - .line2("apt #") - .line3("Suite #") - .line4("delivery instructions") - .streetNumber("25") - .city("San Francisco") - .state("CA") - .postalCode("94104") - .country("US") - .latitude("40.759211") - .longitude("-73.984638") - .county("Santa Clara") - .contactName("Elon Musk") - .salutation("Mr") - .phoneNumber("111-111-1111") - .fax("122-111-1111") - .email("elon@musk.com") - .website("https://elonmusk.com") - .notes("Address notes or delivery instructions.") - .rowVersion("1-12345") - .build()) - .build())) - .compensations(List.of( - EmployeeCompensationInput.builder() - .rate(50d) - .paymentUnit(PaymentUnit.HOUR) - .flsaStatus(FlsaStatus.NONEXEMPT) - .effectiveDate("2021-06-11") + .birthDate(LocalDate.parse("1990-05-20")) + .subsidiary(LinkedSubsidiaryInput.builder() + .displayId("123456") + .name("Acme Inc.") + .build()) + .trackingCategories(List.of( + LinkedTrackingCategory.builder() + .id("123456") + .code("100") + .name("New York") + .parentId("123456") + .parentName("New York") .build())) - .worksRemote(true) + .currency(Currency.USD) + .notes("Some notes about this employee") .addresses(List.of( Address.builder() .id("123") @@ -325,32 +167,7 @@ public class Application { .line2("apt #") .line3("Suite #") .line4("delivery instructions") - .streetNumber("25") - .city("San Francisco") - .state("CA") - .postalCode("94104") - .country("US") - .latitude("40.759211") - .longitude("-73.984638") - .county("Santa Clara") - .contactName("Elon Musk") - .salutation("Mr") - .phoneNumber("111-111-1111") - .fax("122-111-1111") - .email("elon@musk.com") - .website("https://elonmusk.com") - .notes("Address notes or delivery instructions.") - .rowVersion("1-12345") - .build(), - Address.builder() - .id("123") - .type(Type.PRIMARY) - .string("25 Spring Street, Blackburn, VIC 3130") - .name("HQ US") - .line1("Main street") - .line2("apt #") - .line3("Suite #") - .line4("delivery instructions") + .line5("Attention: Finance Dept") .streetNumber("25") .city("San Francisco") .state("CA") @@ -377,131 +194,18 @@ public class Application { .extension("105") .type(PhoneNumberType.PRIMARY) .build())) - .emails(List.of( - Email.builder() - .email("elon@musk.com") - .id("123") - .type(EmailType.PRIMARY) - .build())) .customFields(List.of( - CustomField.of(CustomField1.builder() - .id("2389328923893298") - .name("employee_level") - .description("Employee Level") - .value(CustomField1Value.of("Uses Salesforce and Marketo")) - .build()), CustomField.of(CustomField1.builder() .id("2389328923893298") .name("employee_level") .description("Employee Level") .value(CustomField1Value.of("Uses Salesforce and Marketo")) .build()))) - .socialLinks(List.of( - SocialLink.builder() - .url("https://www.twitter.com/apideck") - .id("12345") - .type("twitter") - .build(), - SocialLink.builder() - .url("https://www.twitter.com/apideck") - .id("12345") - .type("twitter") - .build())) - .bankAccounts(List.of( - BankAccount2.builder() - .bankName("Monzo") - .accountNumber("123465") - .accountName("SPACEX LLC") - .accountType(BankAccount2AccountType.CREDIT_CARD) - .iban("CH2989144532982975332") - .bic("AUDSCHGGXXX") - .routingNumber("012345678") - .bsbNumber("062-001") - .branchIdentifier("001") - .bankCode("BNH") - .currency(Currency.USD) - .build(), - BankAccount2.builder() - .bankName("Monzo") - .accountNumber("123465") - .accountName("SPACEX LLC") - .accountType(BankAccount2AccountType.CREDIT_CARD) - .iban("CH2989144532982975332") - .bic("AUDSCHGGXXX") - .routingNumber("012345678") - .bsbNumber("062-001") - .branchIdentifier("001") - .bankCode("BNH") - .currency(Currency.USD) - .build(), - BankAccount2.builder() - .bankName("Monzo") - .accountNumber("123465") - .accountName("SPACEX LLC") - .accountType(BankAccount2AccountType.CREDIT_CARD) - .iban("CH2989144532982975332") - .bic("AUDSCHGGXXX") - .routingNumber("012345678") - .bsbNumber("062-001") - .branchIdentifier("001") - .bankCode("BNH") - .currency(Currency.USD) - .build())) - .taxCode("1111") - .taxId("234-32-0000") - .dietaryPreference("Veggie") - .foodAllergies(List.of( - "No allergies")) - .probationPeriod(ProbationPeriod.builder() - .startDate(LocalDate.parse("2021-10-01")) - .endDate(LocalDate.parse("2021-11-28")) - .build()) - .tags(List.of( - "New")) .rowVersion("1-12345") - .deleted(true) .passThrough(List.of( PassThroughBody.builder() .serviceId("") .extendPaths(List.of( - ExtendPaths.builder() - .path("$.nested.property") - .value(Map.ofEntries( - Map.entry("TaxClassificationRef", Map.ofEntries( - Map.entry("value", "EUC-99990201-V1-00020000"))))) - .build(), - ExtendPaths.builder() - .path("$.nested.property") - .value(Map.ofEntries( - Map.entry("TaxClassificationRef", Map.ofEntries( - Map.entry("value", "EUC-99990201-V1-00020000"))))) - .build())) - .build(), - PassThroughBody.builder() - .serviceId("") - .extendPaths(List.of( - ExtendPaths.builder() - .path("$.nested.property") - .value(Map.ofEntries( - Map.entry("TaxClassificationRef", Map.ofEntries( - Map.entry("value", "EUC-99990201-V1-00020000"))))) - .build(), - ExtendPaths.builder() - .path("$.nested.property") - .value(Map.ofEntries( - Map.entry("TaxClassificationRef", Map.ofEntries( - Map.entry("value", "EUC-99990201-V1-00020000"))))) - .build())) - .build(), - PassThroughBody.builder() - .serviceId("") - .extendPaths(List.of( - ExtendPaths.builder() - .path("$.nested.property") - .value(Map.ofEntries( - Map.entry("TaxClassificationRef", Map.ofEntries( - Map.entry("value", "EUC-99990201-V1-00020000"))))) - .build(), ExtendPaths.builder() .path("$.nested.property") .value(Map.ofEntries( @@ -513,11 +217,11 @@ public class Application { .serviceId("salesforce") .build(); - HrisEmployeesAddResponse res = sdk.hris().employees().create() + AccountingEmployeesAddResponse res = sdk.accounting().employees().create() .request(req) .call(); - if (res.createEmployeeResponse().isPresent()) { + if (res.createAccountingEmployeeResponse().isPresent()) { // handle response } } @@ -526,13 +230,13 @@ public class Application { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `request` | [HrisEmployeesAddRequest](../../models/operations/HrisEmployeesAddRequest.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `request` | [AccountingEmployeesAddRequest](../../models/operations/AccountingEmployeesAddRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[HrisEmployeesAddResponse](../../models/operations/HrisEmployeesAddResponse.md)** +**[AccountingEmployeesAddResponse](../../models/operations/AccountingEmployeesAddResponse.md)** ### Errors @@ -551,17 +255,15 @@ Get Employee ### Example Usage - + ```java package hello.world; import com.apideck.unify.Apideck; -import com.apideck.unify.models.components.EmployeesOneFilter; import com.apideck.unify.models.errors.*; -import com.apideck.unify.models.operations.HrisEmployeesOneRequest; -import com.apideck.unify.models.operations.HrisEmployeesOneResponse; +import com.apideck.unify.models.operations.AccountingEmployeesOneRequest; +import com.apideck.unify.models.operations.AccountingEmployeesOneResponse; import java.lang.Exception; -import java.util.Map; public class Application { @@ -573,22 +275,17 @@ public class Application { .apiKey(System.getenv().getOrDefault("API_KEY", "")) .build(); - HrisEmployeesOneRequest req = HrisEmployeesOneRequest.builder() + AccountingEmployeesOneRequest req = AccountingEmployeesOneRequest.builder() .id("") .serviceId("salesforce") .fields("id,updated_at") - .filter(EmployeesOneFilter.builder() - .companyId("1234") - .build()) - .passThrough(Map.ofEntries( - Map.entry("search", "San Francisco"))) .build(); - HrisEmployeesOneResponse res = sdk.hris().employees().get() + AccountingEmployeesOneResponse res = sdk.accounting().employees().get() .request(req) .call(); - if (res.getEmployeeResponse().isPresent()) { + if (res.getAccountingEmployeeResponse().isPresent()) { // handle response } } @@ -597,13 +294,13 @@ public class Application { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `request` | [HrisEmployeesOneRequest](../../models/operations/HrisEmployeesOneRequest.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `request` | [AccountingEmployeesOneRequest](../../models/operations/AccountingEmployeesOneRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[HrisEmployeesOneResponse](../../models/operations/HrisEmployeesOneResponse.md)** +**[AccountingEmployeesOneResponse](../../models/operations/AccountingEmployeesOneResponse.md)** ### Errors @@ -622,15 +319,15 @@ Update Employee ### Example Usage - + ```java package hello.world; import com.apideck.unify.Apideck; import com.apideck.unify.models.components.*; import com.apideck.unify.models.errors.*; -import com.apideck.unify.models.operations.HrisEmployeesUpdateRequest; -import com.apideck.unify.models.operations.HrisEmployeesUpdateResponse; +import com.apideck.unify.models.operations.AccountingEmployeesUpdateRequest; +import com.apideck.unify.models.operations.AccountingEmployeesUpdateResponse; import java.lang.Exception; import java.time.LocalDate; import java.util.List; @@ -646,120 +343,54 @@ public class Application { .apiKey(System.getenv().getOrDefault("API_KEY", "")) .build(); - HrisEmployeesUpdateRequest req = HrisEmployeesUpdateRequest.builder() + AccountingEmployeesUpdateRequest req = AccountingEmployeesUpdateRequest.builder() .id("") - .employee(EmployeeInput.builder() - .id("12345") - .firstName("Elon") - .lastName("Musk") - .middleName("D.") - .displayName("Technoking") - .preferredName("Elon Musk") - .initials("EM") - .salutation("Mr") - .title("CEO") - .maritalStatus("married") - .partner(PersonInput.builder() - .firstName("Elon") - .lastName("Musk") - .middleName("D.") - .gender(Gender.MALE) - .initials("EM") - .birthday(LocalDate.parse("2000-08-12")) - .deceasedOn(LocalDate.parse("2000-08-12")) + .accountingEmployee(AccountingEmployeeInput.builder() + .displayId("123456") + .firstName("John") + .lastName("Doe") + .displayName("John Doe") + .emails(List.of( + Email.builder() + .email("elon@musk.com") + .id("123") + .type(EmailType.PRIMARY) + .build())) + .employeeNumber("EMP-001") + .jobTitle("Senior Accountant") + .status(EmployeeStatus.ACTIVE) + .isContractor(false) + .department(LinkedDepartmentInput.builder() + .displayId("123456") + .name("Acme Inc.") .build()) - .division("Europe") - .divisionId("12345") - .departmentId("12345") - .departmentName("12345") - .team(Team.builder() - .id("1234") - .name("Full Stack Engineers") + .location(LinkedLocationInput.builder() + .id("123456") + .displayId("123456") + .name("New York Office") .build()) - .companyId("23456") - .companyName("SpaceX") - .employmentStartDate("2021-10-26") - .employmentEndDate("2028-10-26") - .leavingReason(LeavingReason.RESIGNED) - .employeeNumber("123456-AB") - .employmentStatus(EmploymentStatus.ACTIVE) - .ethnicity("African American") - .manager(Manager.builder() + .manager(AccountingEmployeeManager.builder() .id("12345") - .name("Elon Musk") - .firstName("Elon") - .lastName("Musk") - .email("elon@musk.com") - .employmentStatus(EmploymentStatus.ACTIVE) + .name("Jane Smith") .build()) - .directReports(List.of( - "a0d636c6-43b3-4bde-8c70-85b707d992f4", - "a98lfd96-43b3-4bde-8c70-85b707d992e6")) - .socialSecurityNumber("123456789") - .birthday(LocalDate.parse("2000-08-12")) - .deceasedOn(LocalDate.parse("2000-08-12")) - .countryOfBirth("US") - .description("A description") + .hireDate(LocalDate.parse("2020-01-15")) + .terminationDate(LocalDate.parse("2025-12-31")) .gender(Gender.MALE) - .pronouns("she,her") - .preferredLanguage("EN") - .languages(List.of( - "EN")) - .nationalities(List.of( - "US")) - .photoUrl("https://unavatar.io/elon-musk") - .timezone("Europe/London") - .source("lever") - .sourceId("12345") - .recordUrl("https://app.intercom.io/contacts/12345") - .jobs(List.of( - EmployeeJobInput.builder() - .title("CEO") - .role("Sales") - .startDate(LocalDate.parse("2020-08-12")) - .endDate(LocalDate.parse("2020-08-12")) - .compensationRate(72000d) - .currency(Currency.USD) - .paymentUnit(PaymentUnit.YEAR) - .hiredAt(LocalDate.parse("2020-08-12")) - .isPrimary(true) - .isManager(true) - .status(EmployeeJobStatus.ACTIVE) - .location(Address.builder() - .id("123") - .type(Type.PRIMARY) - .string("25 Spring Street, Blackburn, VIC 3130") - .name("HQ US") - .line1("Main street") - .line2("apt #") - .line3("Suite #") - .line4("delivery instructions") - .streetNumber("25") - .city("San Francisco") - .state("CA") - .postalCode("94104") - .country("US") - .latitude("40.759211") - .longitude("-73.984638") - .county("Santa Clara") - .contactName("Elon Musk") - .salutation("Mr") - .phoneNumber("111-111-1111") - .fax("122-111-1111") - .email("elon@musk.com") - .website("https://elonmusk.com") - .notes("Address notes or delivery instructions.") - .rowVersion("1-12345") - .build()) - .build())) - .compensations(List.of( - EmployeeCompensationInput.builder() - .rate(50d) - .paymentUnit(PaymentUnit.HOUR) - .flsaStatus(FlsaStatus.NONEXEMPT) - .effectiveDate("2021-06-11") + .birthDate(LocalDate.parse("1990-05-20")) + .subsidiary(LinkedSubsidiaryInput.builder() + .displayId("123456") + .name("Acme Inc.") + .build()) + .trackingCategories(List.of( + LinkedTrackingCategory.builder() + .id("123456") + .code("100") + .name("New York") + .parentId("123456") + .parentName("New York") .build())) - .worksRemote(true) + .currency(Currency.USD) + .notes("Some notes about this employee") .addresses(List.of( Address.builder() .id("123") @@ -770,6 +401,7 @@ public class Application { .line2("apt #") .line3("Suite #") .line4("delivery instructions") + .line5("Attention: Finance Dept") .streetNumber("25") .city("San Francisco") .state("CA") @@ -795,89 +427,16 @@ public class Application { .areaCode("323") .extension("105") .type(PhoneNumberType.PRIMARY) - .build(), - PhoneNumber.builder() - .number("111-111-1111") - .id("12345") - .countryCode("1") - .areaCode("323") - .extension("105") - .type(PhoneNumberType.PRIMARY) - .build())) - .emails(List.of( - Email.builder() - .email("elon@musk.com") - .id("123") - .type(EmailType.PRIMARY) .build())) .customFields(List.of( - CustomField.of(CustomField1.builder() - .id("2389328923893298") - .name("employee_level") - .description("Employee Level") - .value(CustomField1Value.of("Uses Salesforce and Marketo")) - .build()), - CustomField.of(CustomField1.builder() - .id("2389328923893298") - .name("employee_level") - .description("Employee Level") - .value(CustomField1Value.of("Uses Salesforce and Marketo")) - .build()), CustomField.of(CustomField1.builder() .id("2389328923893298") .name("employee_level") .description("Employee Level") .value(CustomField1Value.of("Uses Salesforce and Marketo")) .build()))) - .socialLinks(List.of( - SocialLink.builder() - .url("https://www.twitter.com/apideck") - .id("12345") - .type("twitter") - .build(), - SocialLink.builder() - .url("https://www.twitter.com/apideck") - .id("12345") - .type("twitter") - .build())) - .bankAccounts(List.of( - BankAccount2.builder() - .bankName("Monzo") - .accountNumber("123465") - .accountName("SPACEX LLC") - .accountType(BankAccount2AccountType.CREDIT_CARD) - .iban("CH2989144532982975332") - .bic("AUDSCHGGXXX") - .routingNumber("012345678") - .bsbNumber("062-001") - .branchIdentifier("001") - .bankCode("BNH") - .currency(Currency.USD) - .build())) - .taxCode("1111") - .taxId("234-32-0000") - .dietaryPreference("Veggie") - .foodAllergies(List.of( - "No allergies")) - .probationPeriod(ProbationPeriod.builder() - .startDate(LocalDate.parse("2021-10-01")) - .endDate(LocalDate.parse("2021-11-28")) - .build()) - .tags(List.of( - "New")) .rowVersion("1-12345") - .deleted(true) .passThrough(List.of( - PassThroughBody.builder() - .serviceId("") - .extendPaths(List.of( - ExtendPaths.builder() - .path("$.nested.property") - .value(Map.ofEntries( - Map.entry("TaxClassificationRef", Map.ofEntries( - Map.entry("value", "EUC-99990201-V1-00020000"))))) - .build())) - .build(), PassThroughBody.builder() .serviceId("") .extendPaths(List.of( @@ -892,11 +451,11 @@ public class Application { .serviceId("salesforce") .build(); - HrisEmployeesUpdateResponse res = sdk.hris().employees().update() + AccountingEmployeesUpdateResponse res = sdk.accounting().employees().update() .request(req) .call(); - if (res.updateEmployeeResponse().isPresent()) { + if (res.updateAccountingEmployeeResponse().isPresent()) { // handle response } } @@ -905,13 +464,13 @@ public class Application { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `request` | [HrisEmployeesUpdateRequest](../../models/operations/HrisEmployeesUpdateRequest.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `request` | [AccountingEmployeesUpdateRequest](../../models/operations/AccountingEmployeesUpdateRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[HrisEmployeesUpdateResponse](../../models/operations/HrisEmployeesUpdateResponse.md)** +**[AccountingEmployeesUpdateResponse](../../models/operations/AccountingEmployeesUpdateResponse.md)** ### Errors @@ -930,14 +489,14 @@ Delete Employee ### Example Usage - + ```java package hello.world; import com.apideck.unify.Apideck; import com.apideck.unify.models.errors.*; -import com.apideck.unify.models.operations.HrisEmployeesDeleteRequest; -import com.apideck.unify.models.operations.HrisEmployeesDeleteResponse; +import com.apideck.unify.models.operations.AccountingEmployeesDeleteRequest; +import com.apideck.unify.models.operations.AccountingEmployeesDeleteResponse; import java.lang.Exception; public class Application { @@ -950,16 +509,16 @@ public class Application { .apiKey(System.getenv().getOrDefault("API_KEY", "")) .build(); - HrisEmployeesDeleteRequest req = HrisEmployeesDeleteRequest.builder() + AccountingEmployeesDeleteRequest req = AccountingEmployeesDeleteRequest.builder() .id("") .serviceId("salesforce") .build(); - HrisEmployeesDeleteResponse res = sdk.hris().employees().delete() + AccountingEmployeesDeleteResponse res = sdk.accounting().employees().delete() .request(req) .call(); - if (res.deleteEmployeeResponse().isPresent()) { + if (res.deleteAccountingEmployeeResponse().isPresent()) { // handle response } } @@ -968,13 +527,13 @@ public class Application { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `request` | [HrisEmployeesDeleteRequest](../../models/operations/HrisEmployeesDeleteRequest.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `request` | [AccountingEmployeesDeleteRequest](../../models/operations/AccountingEmployeesDeleteRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[HrisEmployeesDeleteResponse](../../models/operations/HrisEmployeesDeleteResponse.md)** +**[AccountingEmployeesDeleteResponse](../../models/operations/AccountingEmployeesDeleteResponse.md)** ### Errors diff --git a/docs/sdks/expensecategories/README.md b/docs/sdks/expensecategories/README.md new file mode 100644 index 000000000..ca0b95506 --- /dev/null +++ b/docs/sdks/expensecategories/README.md @@ -0,0 +1,423 @@ +# Accounting.ExpenseCategories + +## Overview + +### Available Operations + +* [list](#list) - List Expense Categories +* [create](#create) - Create Expense Category +* [get](#get) - Get Expense Category +* [update](#update) - Update Expense Category +* [delete](#delete) - Delete Expense Category + +## list + +List Expense Categories + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.components.ExpenseCategoriesFilter; +import com.apideck.unify.models.components.ExpenseCategoriesFilterStatus; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAllRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAllResponse; +import java.lang.Exception; +import java.time.OffsetDateTime; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + AccountingExpenseCategoriesAllRequest req = AccountingExpenseCategoriesAllRequest.builder() + .serviceId("salesforce") + .fields("id,updated_at") + .filter(ExpenseCategoriesFilter.builder() + .updatedSince(OffsetDateTime.parse("2020-09-30T07:43:32.000Z")) + .status(ExpenseCategoriesFilterStatus.ACTIVE) + .build()) + .build(); + + + sdk.accounting().expenseCategories().list() + .callAsStream() + .forEach((AccountingExpenseCategoriesAllResponse item) -> { + // handle page + }); + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `request` | [AccountingExpenseCategoriesAllRequest](../../models/operations/AccountingExpenseCategoriesAllRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[AccountingExpenseCategoriesAllResponse](../../models/operations/AccountingExpenseCategoriesAllResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## create + +Create Expense Category + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.components.*; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAddRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAddResponse; +import java.lang.Exception; +import java.util.List; +import java.util.Map; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + AccountingExpenseCategoriesAddRequest req = AccountingExpenseCategoriesAddRequest.builder() + .expenseCategory(ExpenseCategoryInput.builder() + .name("Travel") + .displayId("123456") + .code("TRAVEL-001") + .description("Travel-related expenses including flights, hotels, and ground transportation.") + .status(ExpenseCategoryStatus.ACTIVE) + .account(LinkedLedgerAccount.builder() + .id("123456") + .name("Bank account") + .nominalCode("N091") + .code("453") + .parentId("123456") + .displayId("123456") + .build()) + .offsetAccount(LinkedLedgerAccount.builder() + .id("123456") + .name("Bank account") + .nominalCode("N091") + .code("453") + .parentId("123456") + .displayId("123456") + .build()) + .taxRate(LinkedTaxRateInput.builder() + .id("123456") + .code("N-T") + .rate(10d) + .build()) + .rateRequired(false) + .defaultRate(0.67) + .rowVersion("1-12345") + .passThrough(List.of( + PassThroughBody.builder() + .serviceId("") + .extendPaths(List.of( + ExtendPaths.builder() + .path("$.nested.property") + .value(Map.ofEntries( + Map.entry("TaxClassificationRef", Map.ofEntries( + Map.entry("value", "EUC-99990201-V1-00020000"))))) + .build())) + .build())) + .build()) + .serviceId("salesforce") + .build(); + + AccountingExpenseCategoriesAddResponse res = sdk.accounting().expenseCategories().create() + .request(req) + .call(); + + if (res.createExpenseCategoryResponse().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `request` | [AccountingExpenseCategoriesAddRequest](../../models/operations/AccountingExpenseCategoriesAddRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[AccountingExpenseCategoriesAddResponse](../../models/operations/AccountingExpenseCategoriesAddResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## get + +Get Expense Category + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesOneRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesOneResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + AccountingExpenseCategoriesOneRequest req = AccountingExpenseCategoriesOneRequest.builder() + .id("") + .serviceId("salesforce") + .fields("id,updated_at") + .build(); + + AccountingExpenseCategoriesOneResponse res = sdk.accounting().expenseCategories().get() + .request(req) + .call(); + + if (res.getExpenseCategoryResponse().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `request` | [AccountingExpenseCategoriesOneRequest](../../models/operations/AccountingExpenseCategoriesOneRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[AccountingExpenseCategoriesOneResponse](../../models/operations/AccountingExpenseCategoriesOneResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## update + +Update Expense Category + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.components.*; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesUpdateRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesUpdateResponse; +import java.lang.Exception; +import java.util.List; +import java.util.Map; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + AccountingExpenseCategoriesUpdateRequest req = AccountingExpenseCategoriesUpdateRequest.builder() + .id("") + .expenseCategory(ExpenseCategoryInput.builder() + .name("Travel") + .displayId("123456") + .code("TRAVEL-001") + .description("Travel-related expenses including flights, hotels, and ground transportation.") + .status(ExpenseCategoryStatus.ACTIVE) + .account(LinkedLedgerAccount.builder() + .id("123456") + .name("Bank account") + .nominalCode("N091") + .code("453") + .parentId("123456") + .displayId("123456") + .build()) + .offsetAccount(LinkedLedgerAccount.builder() + .id("123456") + .name("Bank account") + .nominalCode("N091") + .code("453") + .parentId("123456") + .displayId("123456") + .build()) + .taxRate(LinkedTaxRateInput.builder() + .id("123456") + .code("N-T") + .rate(10d) + .build()) + .rateRequired(false) + .defaultRate(0.67) + .rowVersion("1-12345") + .passThrough(List.of( + PassThroughBody.builder() + .serviceId("") + .extendPaths(List.of( + ExtendPaths.builder() + .path("$.nested.property") + .value(Map.ofEntries( + Map.entry("TaxClassificationRef", Map.ofEntries( + Map.entry("value", "EUC-99990201-V1-00020000"))))) + .build())) + .build())) + .build()) + .serviceId("salesforce") + .build(); + + AccountingExpenseCategoriesUpdateResponse res = sdk.accounting().expenseCategories().update() + .request(req) + .call(); + + if (res.updateExpenseCategoryResponse().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `request` | [AccountingExpenseCategoriesUpdateRequest](../../models/operations/AccountingExpenseCategoriesUpdateRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[AccountingExpenseCategoriesUpdateResponse](../../models/operations/AccountingExpenseCategoriesUpdateResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## delete + +Delete Expense Category + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesDeleteRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesDeleteResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + AccountingExpenseCategoriesDeleteRequest req = AccountingExpenseCategoriesDeleteRequest.builder() + .id("") + .serviceId("salesforce") + .build(); + + AccountingExpenseCategoriesDeleteResponse res = sdk.accounting().expenseCategories().delete() + .request(req) + .call(); + + if (res.deleteExpenseCategoryResponse().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `request` | [AccountingExpenseCategoriesDeleteRequest](../../models/operations/AccountingExpenseCategoriesDeleteRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[AccountingExpenseCategoriesDeleteResponse](../../models/operations/AccountingExpenseCategoriesDeleteResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/expensereports/README.md b/docs/sdks/expensereports/README.md new file mode 100644 index 000000000..f804f75a7 --- /dev/null +++ b/docs/sdks/expensereports/README.md @@ -0,0 +1,487 @@ +# Accounting.ExpenseReports + +## Overview + +### Available Operations + +* [list](#list) - List Expense Reports +* [create](#create) - Create Expense Report +* [get](#get) - Get Expense Report +* [update](#update) - Update Expense Report +* [delete](#delete) - Delete Expense Report + +## list + +List Expense Reports + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.components.ExpenseReportsFilter; +import com.apideck.unify.models.components.ExpenseReportsFilterStatus; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.AccountingExpenseReportsAllRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsAllResponse; +import java.lang.Exception; +import java.time.OffsetDateTime; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + AccountingExpenseReportsAllRequest req = AccountingExpenseReportsAllRequest.builder() + .serviceId("salesforce") + .fields("id,updated_at") + .filter(ExpenseReportsFilter.builder() + .updatedSince(OffsetDateTime.parse("2020-09-30T07:43:32.000Z")) + .status(ExpenseReportsFilterStatus.SUBMITTED) + .build()) + .build(); + + + sdk.accounting().expenseReports().list() + .callAsStream() + .forEach((AccountingExpenseReportsAllResponse item) -> { + // handle page + }); + + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `request` | [AccountingExpenseReportsAllRequest](../../models/operations/AccountingExpenseReportsAllRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[AccountingExpenseReportsAllResponse](../../models/operations/AccountingExpenseReportsAllResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## create + +Create Expense Report + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.components.*; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.AccountingExpenseReportsAddRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsAddResponse; +import java.lang.Exception; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + AccountingExpenseReportsAddRequest req = AccountingExpenseReportsAddRequest.builder() + .expenseReport(ExpenseReportInput.builder() + .employee(ExpenseReportEmployee.builder() + .id("12345") + .displayName("John Doe") + .build()) + .transactionDate(OffsetDateTime.parse("2021-05-01T12:00:00.000Z")) + .lineItems(List.of()) + .displayId("123456") + .number("ER-001") + .title("Q1 Business Travel") + .status(ExpenseReportStatus.SUBMITTED) + .postingDate(LocalDate.parse("2024-06-01")) + .dueDate(LocalDate.parse("2024-06-15")) + .currency(Currency.USD) + .currencyRate(0.69) + .subTotal(250d) + .totalTax(25d) + .totalAmount(1250.75) + .reimbursableAmount(1100d) + .memo("Business travel expenses for Q1 client meetings") + .department(LinkedDepartmentInput.builder() + .displayId("123456") + .name("Acme Inc.") + .build()) + .location(LinkedLocationInput.builder() + .id("123456") + .displayId("123456") + .name("New York Office") + .build()) + .account(JsonNullable.of(null)) + .accountingPeriod(AccountingPeriod.builder() + .id("12345") + .name("Q1 2024") + .build()) + .subsidiary(LinkedSubsidiaryInput.builder() + .displayId("123456") + .name("Acme Inc.") + .build()) + .trackingCategories(List.of( + LinkedTrackingCategory.builder() + .id("123456") + .code("100") + .name("New York") + .parentId("123456") + .parentName("New York") + .build())) + .taxInclusive(true) + .approvedBy(ApprovedBy.builder() + .id("12345") + .displayName("Jane Smith") + .build()) + .customFields(List.of( + CustomField.of(CustomField1.builder() + .id("2389328923893298") + .name("employee_level") + .description("Employee Level") + .value(CustomField1Value.of("Uses Salesforce and Marketo")) + .build()))) + .rowVersion("1-12345") + .passThrough(List.of( + PassThroughBody.builder() + .serviceId("") + .extendPaths(List.of( + ExtendPaths.builder() + .path("$.nested.property") + .value(Map.ofEntries( + Map.entry("TaxClassificationRef", Map.ofEntries( + Map.entry("value", "EUC-99990201-V1-00020000"))))) + .build())) + .build())) + .build()) + .serviceId("salesforce") + .build(); + + AccountingExpenseReportsAddResponse res = sdk.accounting().expenseReports().create() + .request(req) + .call(); + + if (res.createExpenseReportResponse().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `request` | [AccountingExpenseReportsAddRequest](../../models/operations/AccountingExpenseReportsAddRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[AccountingExpenseReportsAddResponse](../../models/operations/AccountingExpenseReportsAddResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## get + +Get Expense Report + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.AccountingExpenseReportsOneRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsOneResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + AccountingExpenseReportsOneRequest req = AccountingExpenseReportsOneRequest.builder() + .id("") + .serviceId("salesforce") + .fields("id,updated_at") + .build(); + + AccountingExpenseReportsOneResponse res = sdk.accounting().expenseReports().get() + .request(req) + .call(); + + if (res.getExpenseReportResponse().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `request` | [AccountingExpenseReportsOneRequest](../../models/operations/AccountingExpenseReportsOneRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[AccountingExpenseReportsOneResponse](../../models/operations/AccountingExpenseReportsOneResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## update + +Update Expense Report + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.components.*; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.AccountingExpenseReportsUpdateRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsUpdateResponse; +import java.lang.Exception; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + AccountingExpenseReportsUpdateRequest req = AccountingExpenseReportsUpdateRequest.builder() + .id("") + .expenseReport(ExpenseReportInput.builder() + .employee(ExpenseReportEmployee.builder() + .id("12345") + .displayName("John Doe") + .build()) + .transactionDate(OffsetDateTime.parse("2021-05-01T12:00:00.000Z")) + .lineItems(List.of()) + .displayId("123456") + .number("ER-001") + .title("Q1 Business Travel") + .status(ExpenseReportStatus.SUBMITTED) + .postingDate(LocalDate.parse("2024-06-01")) + .dueDate(LocalDate.parse("2024-06-15")) + .currency(Currency.USD) + .currencyRate(0.69) + .subTotal(250d) + .totalTax(25d) + .totalAmount(1250.75) + .reimbursableAmount(1100d) + .memo("Business travel expenses for Q1 client meetings") + .department(LinkedDepartmentInput.builder() + .displayId("123456") + .name("Acme Inc.") + .build()) + .location(LinkedLocationInput.builder() + .id("123456") + .displayId("123456") + .name("New York Office") + .build()) + .account(LinkedLedgerAccount.builder() + .id("123456") + .name("Bank account") + .nominalCode("N091") + .code("453") + .parentId("123456") + .displayId("123456") + .build()) + .accountingPeriod(AccountingPeriod.builder() + .id("12345") + .name("Q1 2024") + .build()) + .subsidiary(LinkedSubsidiaryInput.builder() + .displayId("123456") + .name("Acme Inc.") + .build()) + .trackingCategories(JsonNullable.of(null)) + .taxInclusive(true) + .approvedBy(ApprovedBy.builder() + .id("12345") + .displayName("Jane Smith") + .build()) + .customFields(List.of( + CustomField.of(CustomField1.builder() + .id("2389328923893298") + .name("employee_level") + .description("Employee Level") + .value(CustomField1Value.of("Uses Salesforce and Marketo")) + .build()))) + .rowVersion("1-12345") + .passThrough(List.of( + PassThroughBody.builder() + .serviceId("") + .extendPaths(List.of( + ExtendPaths.builder() + .path("$.nested.property") + .value(Map.ofEntries( + Map.entry("TaxClassificationRef", Map.ofEntries( + Map.entry("value", "EUC-99990201-V1-00020000"))))) + .build())) + .build())) + .build()) + .serviceId("salesforce") + .build(); + + AccountingExpenseReportsUpdateResponse res = sdk.accounting().expenseReports().update() + .request(req) + .call(); + + if (res.updateExpenseReportResponse().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `request` | [AccountingExpenseReportsUpdateRequest](../../models/operations/AccountingExpenseReportsUpdateRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[AccountingExpenseReportsUpdateResponse](../../models/operations/AccountingExpenseReportsUpdateResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | + +## delete + +Delete Expense Report + +### Example Usage + + +```java +package hello.world; + +import com.apideck.unify.Apideck; +import com.apideck.unify.models.errors.*; +import com.apideck.unify.models.operations.AccountingExpenseReportsDeleteRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsDeleteResponse; +import java.lang.Exception; + +public class Application { + + public static void main(String[] args) throws BadRequestResponse, UnauthorizedResponse, PaymentRequiredResponse, NotFoundResponse, UnprocessableResponse, Exception { + + Apideck sdk = Apideck.builder() + .consumerId("test-consumer") + .appId("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX") + .apiKey(System.getenv().getOrDefault("API_KEY", "")) + .build(); + + AccountingExpenseReportsDeleteRequest req = AccountingExpenseReportsDeleteRequest.builder() + .id("") + .serviceId("salesforce") + .build(); + + AccountingExpenseReportsDeleteResponse res = sdk.accounting().expenseReports().delete() + .request(req) + .call(); + + if (res.deleteExpenseReportResponse().isPresent()) { + // handle response + } + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `request` | [AccountingExpenseReportsDeleteRequest](../../models/operations/AccountingExpenseReportsDeleteRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[AccountingExpenseReportsDeleteResponse](../../models/operations/AccountingExpenseReportsDeleteResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models/errors/BadRequestResponse | 400 | application/json | +| models/errors/UnauthorizedResponse | 401 | application/json | +| models/errors/PaymentRequiredResponse | 402 | application/json | +| models/errors/NotFoundResponse | 404 | application/json | +| models/errors/UnprocessableResponse | 422 | application/json | +| models/errors/APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 9add46315..831218560 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ groupId=com.apideck artifactId=unify -version=0.30.3 +version=0.30.4 org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g diff --git a/src/main/java/com/apideck/unify/Accounting.java b/src/main/java/com/apideck/unify/Accounting.java index 9dae508a7..f0b19e410 100644 --- a/src/main/java/com/apideck/unify/Accounting.java +++ b/src/main/java/com/apideck/unify/Accounting.java @@ -39,6 +39,9 @@ public class Accounting { private final Categories categories; private final Quotes quotes; private final Projects projects; + private final Employees employees; + private final ExpenseCategories expenseCategories; + private final ExpenseReports expenseReports; Accounting(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; @@ -71,6 +74,9 @@ public class Accounting { this.categories = new Categories(this.sdkConfiguration); this.quotes = new Quotes(this.sdkConfiguration); this.projects = new Projects(this.sdkConfiguration); + this.employees = new Employees(this.sdkConfiguration); + this.expenseCategories = new ExpenseCategories(this.sdkConfiguration); + this.expenseReports = new ExpenseReports(this.sdkConfiguration); this.asyncSDK = new AsyncAccounting(this, sdkConfiguration); } @@ -190,6 +196,18 @@ public final Projects projects() { return projects; } + public final Employees employees() { + return employees; + } + + public final ExpenseCategories expenseCategories() { + return expenseCategories; + } + + public final ExpenseReports expenseReports() { + return expenseReports; + } + /** * Switches to the async SDK. * diff --git a/src/main/java/com/apideck/unify/ApideckEmployees.java b/src/main/java/com/apideck/unify/ApideckEmployees.java new file mode 100644 index 000000000..ef23980d9 --- /dev/null +++ b/src/main/java/com/apideck/unify/ApideckEmployees.java @@ -0,0 +1,261 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.models.operations.HrisEmployeesAddRequest; +import com.apideck.unify.models.operations.HrisEmployeesAddRequestBuilder; +import com.apideck.unify.models.operations.HrisEmployeesAddResponse; +import com.apideck.unify.models.operations.HrisEmployeesAllRequest; +import com.apideck.unify.models.operations.HrisEmployeesAllRequestBuilder; +import com.apideck.unify.models.operations.HrisEmployeesAllResponse; +import com.apideck.unify.models.operations.HrisEmployeesDeleteRequest; +import com.apideck.unify.models.operations.HrisEmployeesDeleteRequestBuilder; +import com.apideck.unify.models.operations.HrisEmployeesDeleteResponse; +import com.apideck.unify.models.operations.HrisEmployeesOneRequest; +import com.apideck.unify.models.operations.HrisEmployeesOneRequestBuilder; +import com.apideck.unify.models.operations.HrisEmployeesOneResponse; +import com.apideck.unify.models.operations.HrisEmployeesUpdateRequest; +import com.apideck.unify.models.operations.HrisEmployeesUpdateRequestBuilder; +import com.apideck.unify.models.operations.HrisEmployeesUpdateResponse; +import com.apideck.unify.operations.HrisEmployeesAdd; +import com.apideck.unify.operations.HrisEmployeesAll; +import com.apideck.unify.operations.HrisEmployeesDelete; +import com.apideck.unify.operations.HrisEmployeesOne; +import com.apideck.unify.operations.HrisEmployeesUpdate; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import java.util.Optional; + + +public class ApideckEmployees { + private static final Headers _headers = Headers.EMPTY; + private final SDKConfiguration sdkConfiguration; + private final AsyncApideckEmployees asyncSDK; + + ApideckEmployees(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncApideckEmployees(this, sdkConfiguration); + } + + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncApideckEmployees async() { + return asyncSDK; + } + + /** + * List Employees + * + *

Apideck operates as a stateless Unified API, which means that the list endpoint only provides a + * portion of the employee model. This is due to the fact that most HRIS systems do not readily provide + * all data in every call. However, you can access the complete employee model through an employee + * detail call. + * + * @return The call builder + */ + public HrisEmployeesAllRequestBuilder list() { + return new HrisEmployeesAllRequestBuilder(sdkConfiguration); + } + + /** + * List Employees + * + *

Apideck operates as a stateless Unified API, which means that the list endpoint only provides a + * portion of the employee model. This is due to the fact that most HRIS systems do not readily provide + * all data in every call. However, you can access the complete employee model through an employee + * detail call. + * + * @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 HrisEmployeesAllResponse list(HrisEmployeesAllRequest request) { + return list(request, Optional.empty()); + } + + /** + * List Employees + * + *

Apideck operates as a stateless Unified API, which means that the list endpoint only provides a + * portion of the employee model. This is due to the fact that most HRIS systems do not readily provide + * all data in every call. However, you can access the complete employee model through an employee + * detail call. + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public HrisEmployeesAllResponse list(HrisEmployeesAllRequest request, Optional options) { + RequestOperation operation + = new HrisEmployeesAll.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Create Employee + * + *

Create Employee + * + * @return The call builder + */ + public HrisEmployeesAddRequestBuilder create() { + return new HrisEmployeesAddRequestBuilder(sdkConfiguration); + } + + /** + * Create Employee + * + *

Create Employee + * + * @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 HrisEmployeesAddResponse create(HrisEmployeesAddRequest request) { + return create(request, Optional.empty()); + } + + /** + * Create Employee + * + *

Create Employee + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public HrisEmployeesAddResponse create(HrisEmployeesAddRequest request, Optional options) { + RequestOperation operation + = new HrisEmployeesAdd.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Get Employee + * + *

Get Employee + * + * @return The call builder + */ + public HrisEmployeesOneRequestBuilder get() { + return new HrisEmployeesOneRequestBuilder(sdkConfiguration); + } + + /** + * Get Employee + * + *

Get Employee + * + * @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 HrisEmployeesOneResponse get(HrisEmployeesOneRequest request) { + return get(request, Optional.empty()); + } + + /** + * Get Employee + * + *

Get Employee + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public HrisEmployeesOneResponse get(HrisEmployeesOneRequest request, Optional options) { + RequestOperation operation + = new HrisEmployeesOne.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Update Employee + * + *

Update Employee + * + * @return The call builder + */ + public HrisEmployeesUpdateRequestBuilder update() { + return new HrisEmployeesUpdateRequestBuilder(sdkConfiguration); + } + + /** + * Update Employee + * + *

Update Employee + * + * @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 HrisEmployeesUpdateResponse update(HrisEmployeesUpdateRequest request) { + return update(request, Optional.empty()); + } + + /** + * Update Employee + * + *

Update Employee + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public HrisEmployeesUpdateResponse update(HrisEmployeesUpdateRequest request, Optional options) { + RequestOperation operation + = new HrisEmployeesUpdate.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Delete Employee + * + *

Delete Employee + * + * @return The call builder + */ + public HrisEmployeesDeleteRequestBuilder delete() { + return new HrisEmployeesDeleteRequestBuilder(sdkConfiguration); + } + + /** + * Delete Employee + * + *

Delete Employee + * + * @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 HrisEmployeesDeleteResponse delete(HrisEmployeesDeleteRequest request) { + return delete(request, Optional.empty()); + } + + /** + * Delete Employee + * + *

Delete Employee + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public HrisEmployeesDeleteResponse delete(HrisEmployeesDeleteRequest request, Optional options) { + RequestOperation operation + = new HrisEmployeesDelete.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + +} diff --git a/src/main/java/com/apideck/unify/AsyncAccounting.java b/src/main/java/com/apideck/unify/AsyncAccounting.java index 8e99698d7..d78f94dab 100644 --- a/src/main/java/com/apideck/unify/AsyncAccounting.java +++ b/src/main/java/com/apideck/unify/AsyncAccounting.java @@ -38,6 +38,9 @@ public class AsyncAccounting { private final AsyncCategories categories; private final AsyncQuotes quotes; private final AsyncProjects projects; + private final AsyncEmployees employees; + private final AsyncExpenseCategories expenseCategories; + private final AsyncExpenseReports expenseReports; private final Accounting syncSDK; AsyncAccounting(Accounting syncSDK, SDKConfiguration sdkConfiguration) { @@ -71,6 +74,9 @@ public class AsyncAccounting { this.categories = new AsyncCategories(syncSDK.categories(), this.sdkConfiguration); this.quotes = new AsyncQuotes(syncSDK.quotes(), this.sdkConfiguration); this.projects = new AsyncProjects(syncSDK.projects(), this.sdkConfiguration); + this.employees = new AsyncEmployees(syncSDK.employees(), this.sdkConfiguration); + this.expenseCategories = new AsyncExpenseCategories(syncSDK.expenseCategories(), this.sdkConfiguration); + this.expenseReports = new AsyncExpenseReports(syncSDK.expenseReports(), this.sdkConfiguration); this.syncSDK = syncSDK; } @@ -190,6 +196,18 @@ public final AsyncProjects projects() { return projects; } + public final AsyncEmployees employees() { + return employees; + } + + public final AsyncExpenseCategories expenseCategories() { + return expenseCategories; + } + + public final AsyncExpenseReports expenseReports() { + return expenseReports; + } + /** * Switches to the sync SDK. * diff --git a/src/main/java/com/apideck/unify/AsyncApideckEmployees.java b/src/main/java/com/apideck/unify/AsyncApideckEmployees.java new file mode 100644 index 000000000..bc40f5e1f --- /dev/null +++ b/src/main/java/com/apideck/unify/AsyncApideckEmployees.java @@ -0,0 +1,272 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.models.operations.HrisEmployeesAddRequest; +import com.apideck.unify.models.operations.HrisEmployeesAllRequest; +import com.apideck.unify.models.operations.HrisEmployeesDeleteRequest; +import com.apideck.unify.models.operations.HrisEmployeesOneRequest; +import com.apideck.unify.models.operations.HrisEmployeesUpdateRequest; +import com.apideck.unify.models.operations.async.HrisEmployeesAddRequestBuilder; +import com.apideck.unify.models.operations.async.HrisEmployeesAddResponse; +import com.apideck.unify.models.operations.async.HrisEmployeesAllRequestBuilder; +import com.apideck.unify.models.operations.async.HrisEmployeesAllResponse; +import com.apideck.unify.models.operations.async.HrisEmployeesDeleteRequestBuilder; +import com.apideck.unify.models.operations.async.HrisEmployeesDeleteResponse; +import com.apideck.unify.models.operations.async.HrisEmployeesOneRequestBuilder; +import com.apideck.unify.models.operations.async.HrisEmployeesOneResponse; +import com.apideck.unify.models.operations.async.HrisEmployeesUpdateRequestBuilder; +import com.apideck.unify.models.operations.async.HrisEmployeesUpdateResponse; +import com.apideck.unify.operations.HrisEmployeesAdd; +import com.apideck.unify.operations.HrisEmployeesAll; +import com.apideck.unify.operations.HrisEmployeesDelete; +import com.apideck.unify.operations.HrisEmployeesOne; +import com.apideck.unify.operations.HrisEmployeesUpdate; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + + +public class AsyncApideckEmployees { + private static final Headers _headers = Headers.EMPTY; + private final SDKConfiguration sdkConfiguration; + private final ApideckEmployees syncSDK; + + AsyncApideckEmployees(ApideckEmployees syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public ApideckEmployees sync() { + return syncSDK; + } + + + /** + * List Employees + * + *

Apideck operates as a stateless Unified API, which means that the list endpoint only provides a + * portion of the employee model. This is due to the fact that most HRIS systems do not readily provide + * all data in every call. However, you can access the complete employee model through an employee + * detail call. + * + * @return The async call builder + */ + public HrisEmployeesAllRequestBuilder list() { + return new HrisEmployeesAllRequestBuilder(sdkConfiguration); + } + + /** + * List Employees + * + *

Apideck operates as a stateless Unified API, which means that the list endpoint only provides a + * portion of the employee model. This is due to the fact that most HRIS systems do not readily provide + * all data in every call. However, you can access the complete employee model through an employee + * detail call. + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture list(HrisEmployeesAllRequest request) { + return list(request, Optional.empty()); + } + + /** + * List Employees + * + *

Apideck operates as a stateless Unified API, which means that the list endpoint only provides a + * portion of the employee model. This is due to the fact that most HRIS systems do not readily provide + * all data in every call. However, you can access the complete employee model through an employee + * detail call. + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture list(HrisEmployeesAllRequest request, Optional options) { + AsyncRequestOperation operation + = new HrisEmployeesAll.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Create Employee + * + *

Create Employee + * + * @return The async call builder + */ + public HrisEmployeesAddRequestBuilder create() { + return new HrisEmployeesAddRequestBuilder(sdkConfiguration); + } + + /** + * Create Employee + * + *

Create Employee + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture create(HrisEmployeesAddRequest request) { + return create(request, Optional.empty()); + } + + /** + * Create Employee + * + *

Create Employee + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture create(HrisEmployeesAddRequest request, Optional options) { + AsyncRequestOperation operation + = new HrisEmployeesAdd.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Employee + * + *

Get Employee + * + * @return The async call builder + */ + public HrisEmployeesOneRequestBuilder get() { + return new HrisEmployeesOneRequestBuilder(sdkConfiguration); + } + + /** + * Get Employee + * + *

Get Employee + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture get(HrisEmployeesOneRequest request) { + return get(request, Optional.empty()); + } + + /** + * Get Employee + * + *

Get Employee + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture get(HrisEmployeesOneRequest request, Optional options) { + AsyncRequestOperation operation + = new HrisEmployeesOne.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Update Employee + * + *

Update Employee + * + * @return The async call builder + */ + public HrisEmployeesUpdateRequestBuilder update() { + return new HrisEmployeesUpdateRequestBuilder(sdkConfiguration); + } + + /** + * Update Employee + * + *

Update Employee + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture update(HrisEmployeesUpdateRequest request) { + return update(request, Optional.empty()); + } + + /** + * Update Employee + * + *

Update Employee + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture update(HrisEmployeesUpdateRequest request, Optional options) { + AsyncRequestOperation operation + = new HrisEmployeesUpdate.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Delete Employee + * + *

Delete Employee + * + * @return The async call builder + */ + public HrisEmployeesDeleteRequestBuilder delete() { + return new HrisEmployeesDeleteRequestBuilder(sdkConfiguration); + } + + /** + * Delete Employee + * + *

Delete Employee + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture delete(HrisEmployeesDeleteRequest request) { + return delete(request, Optional.empty()); + } + + /** + * Delete Employee + * + *

Delete Employee + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture delete(HrisEmployeesDeleteRequest request, Optional options) { + AsyncRequestOperation operation + = new HrisEmployeesDelete.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/com/apideck/unify/AsyncEmployees.java b/src/main/java/com/apideck/unify/AsyncEmployees.java index 2199e303f..f890f3c82 100644 --- a/src/main/java/com/apideck/unify/AsyncEmployees.java +++ b/src/main/java/com/apideck/unify/AsyncEmployees.java @@ -5,26 +5,26 @@ import static com.apideck.unify.operations.Operations.AsyncRequestOperation; -import com.apideck.unify.models.operations.HrisEmployeesAddRequest; -import com.apideck.unify.models.operations.HrisEmployeesAllRequest; -import com.apideck.unify.models.operations.HrisEmployeesDeleteRequest; -import com.apideck.unify.models.operations.HrisEmployeesOneRequest; -import com.apideck.unify.models.operations.HrisEmployeesUpdateRequest; -import com.apideck.unify.models.operations.async.HrisEmployeesAddRequestBuilder; -import com.apideck.unify.models.operations.async.HrisEmployeesAddResponse; -import com.apideck.unify.models.operations.async.HrisEmployeesAllRequestBuilder; -import com.apideck.unify.models.operations.async.HrisEmployeesAllResponse; -import com.apideck.unify.models.operations.async.HrisEmployeesDeleteRequestBuilder; -import com.apideck.unify.models.operations.async.HrisEmployeesDeleteResponse; -import com.apideck.unify.models.operations.async.HrisEmployeesOneRequestBuilder; -import com.apideck.unify.models.operations.async.HrisEmployeesOneResponse; -import com.apideck.unify.models.operations.async.HrisEmployeesUpdateRequestBuilder; -import com.apideck.unify.models.operations.async.HrisEmployeesUpdateResponse; -import com.apideck.unify.operations.HrisEmployeesAdd; -import com.apideck.unify.operations.HrisEmployeesAll; -import com.apideck.unify.operations.HrisEmployeesDelete; -import com.apideck.unify.operations.HrisEmployeesOne; -import com.apideck.unify.operations.HrisEmployeesUpdate; +import com.apideck.unify.models.operations.AccountingEmployeesAddRequest; +import com.apideck.unify.models.operations.AccountingEmployeesAllRequest; +import com.apideck.unify.models.operations.AccountingEmployeesDeleteRequest; +import com.apideck.unify.models.operations.AccountingEmployeesOneRequest; +import com.apideck.unify.models.operations.AccountingEmployeesUpdateRequest; +import com.apideck.unify.models.operations.async.AccountingEmployeesAddRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingEmployeesAddResponse; +import com.apideck.unify.models.operations.async.AccountingEmployeesAllRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingEmployeesAllResponse; +import com.apideck.unify.models.operations.async.AccountingEmployeesDeleteRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingEmployeesDeleteResponse; +import com.apideck.unify.models.operations.async.AccountingEmployeesOneRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingEmployeesOneResponse; +import com.apideck.unify.models.operations.async.AccountingEmployeesUpdateRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingEmployeesUpdateResponse; +import com.apideck.unify.operations.AccountingEmployeesAdd; +import com.apideck.unify.operations.AccountingEmployeesAll; +import com.apideck.unify.operations.AccountingEmployeesDelete; +import com.apideck.unify.operations.AccountingEmployeesOne; +import com.apideck.unify.operations.AccountingEmployeesUpdate; import com.apideck.unify.utils.Headers; import com.apideck.unify.utils.Options; import java.util.Optional; @@ -54,47 +54,38 @@ public Employees sync() { /** * List Employees * - *

Apideck operates as a stateless Unified API, which means that the list endpoint only provides a - * portion of the employee model. This is due to the fact that most HRIS systems do not readily provide - * all data in every call. However, you can access the complete employee model through an employee - * detail call. + *

List Employees * * @return The async call builder */ - public HrisEmployeesAllRequestBuilder list() { - return new HrisEmployeesAllRequestBuilder(sdkConfiguration); + public AccountingEmployeesAllRequestBuilder list() { + return new AccountingEmployeesAllRequestBuilder(sdkConfiguration); } /** * List Employees * - *

Apideck operates as a stateless Unified API, which means that the list endpoint only provides a - * portion of the employee model. This is due to the fact that most HRIS systems do not readily provide - * all data in every call. However, you can access the complete employee model through an employee - * detail call. + *

List Employees * * @param request The request object containing all the parameters for the API call. - * @return {@code CompletableFuture} - The async response + * @return {@code CompletableFuture} - The async response */ - public CompletableFuture list(HrisEmployeesAllRequest request) { + public CompletableFuture list(AccountingEmployeesAllRequest request) { return list(request, Optional.empty()); } /** * List Employees * - *

Apideck operates as a stateless Unified API, which means that the list endpoint only provides a - * portion of the employee model. This is due to the fact that most HRIS systems do not readily provide - * all data in every call. However, you can access the complete employee model through an employee - * detail call. + *

List Employees * * @param request The request object containing all the parameters for the API call. * @param options additional options - * @return {@code CompletableFuture} - The async response + * @return {@code CompletableFuture} - The async response */ - public CompletableFuture list(HrisEmployeesAllRequest request, Optional options) { - AsyncRequestOperation operation - = new HrisEmployeesAll.Async( + public CompletableFuture list(AccountingEmployeesAllRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingEmployeesAll.Async( sdkConfiguration, options, sdkConfiguration.retryScheduler(), _headers); return operation.doRequest(request) @@ -109,8 +100,8 @@ public CompletableFuture list(HrisEmployeesAllRequest * * @return The async call builder */ - public HrisEmployeesAddRequestBuilder create() { - return new HrisEmployeesAddRequestBuilder(sdkConfiguration); + public AccountingEmployeesAddRequestBuilder create() { + return new AccountingEmployeesAddRequestBuilder(sdkConfiguration); } /** @@ -119,9 +110,9 @@ public HrisEmployeesAddRequestBuilder create() { *

Create Employee * * @param request The request object containing all the parameters for the API call. - * @return {@code CompletableFuture} - The async response + * @return {@code CompletableFuture} - The async response */ - public CompletableFuture create(HrisEmployeesAddRequest request) { + public CompletableFuture create(AccountingEmployeesAddRequest request) { return create(request, Optional.empty()); } @@ -132,11 +123,11 @@ public CompletableFuture create(HrisEmployeesAddReques * * @param request The request object containing all the parameters for the API call. * @param options additional options - * @return {@code CompletableFuture} - The async response + * @return {@code CompletableFuture} - The async response */ - public CompletableFuture create(HrisEmployeesAddRequest request, Optional options) { - AsyncRequestOperation operation - = new HrisEmployeesAdd.Async( + public CompletableFuture create(AccountingEmployeesAddRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingEmployeesAdd.Async( sdkConfiguration, options, sdkConfiguration.retryScheduler(), _headers); return operation.doRequest(request) @@ -151,8 +142,8 @@ public CompletableFuture create(HrisEmployeesAddReques * * @return The async call builder */ - public HrisEmployeesOneRequestBuilder get() { - return new HrisEmployeesOneRequestBuilder(sdkConfiguration); + public AccountingEmployeesOneRequestBuilder get() { + return new AccountingEmployeesOneRequestBuilder(sdkConfiguration); } /** @@ -161,9 +152,9 @@ public HrisEmployeesOneRequestBuilder get() { *

Get Employee * * @param request The request object containing all the parameters for the API call. - * @return {@code CompletableFuture} - The async response + * @return {@code CompletableFuture} - The async response */ - public CompletableFuture get(HrisEmployeesOneRequest request) { + public CompletableFuture get(AccountingEmployeesOneRequest request) { return get(request, Optional.empty()); } @@ -174,11 +165,11 @@ public CompletableFuture get(HrisEmployeesOneRequest r * * @param request The request object containing all the parameters for the API call. * @param options additional options - * @return {@code CompletableFuture} - The async response + * @return {@code CompletableFuture} - The async response */ - public CompletableFuture get(HrisEmployeesOneRequest request, Optional options) { - AsyncRequestOperation operation - = new HrisEmployeesOne.Async( + public CompletableFuture get(AccountingEmployeesOneRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingEmployeesOne.Async( sdkConfiguration, options, sdkConfiguration.retryScheduler(), _headers); return operation.doRequest(request) @@ -193,8 +184,8 @@ public CompletableFuture get(HrisEmployeesOneRequest r * * @return The async call builder */ - public HrisEmployeesUpdateRequestBuilder update() { - return new HrisEmployeesUpdateRequestBuilder(sdkConfiguration); + public AccountingEmployeesUpdateRequestBuilder update() { + return new AccountingEmployeesUpdateRequestBuilder(sdkConfiguration); } /** @@ -203,9 +194,9 @@ public HrisEmployeesUpdateRequestBuilder update() { *

Update Employee * * @param request The request object containing all the parameters for the API call. - * @return {@code CompletableFuture} - The async response + * @return {@code CompletableFuture} - The async response */ - public CompletableFuture update(HrisEmployeesUpdateRequest request) { + public CompletableFuture update(AccountingEmployeesUpdateRequest request) { return update(request, Optional.empty()); } @@ -216,11 +207,11 @@ public CompletableFuture update(HrisEmployeesUpdate * * @param request The request object containing all the parameters for the API call. * @param options additional options - * @return {@code CompletableFuture} - The async response + * @return {@code CompletableFuture} - The async response */ - public CompletableFuture update(HrisEmployeesUpdateRequest request, Optional options) { - AsyncRequestOperation operation - = new HrisEmployeesUpdate.Async( + public CompletableFuture update(AccountingEmployeesUpdateRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingEmployeesUpdate.Async( sdkConfiguration, options, sdkConfiguration.retryScheduler(), _headers); return operation.doRequest(request) @@ -235,8 +226,8 @@ public CompletableFuture update(HrisEmployeesUpdate * * @return The async call builder */ - public HrisEmployeesDeleteRequestBuilder delete() { - return new HrisEmployeesDeleteRequestBuilder(sdkConfiguration); + public AccountingEmployeesDeleteRequestBuilder delete() { + return new AccountingEmployeesDeleteRequestBuilder(sdkConfiguration); } /** @@ -245,9 +236,9 @@ public HrisEmployeesDeleteRequestBuilder delete() { *

Delete Employee * * @param request The request object containing all the parameters for the API call. - * @return {@code CompletableFuture} - The async response + * @return {@code CompletableFuture} - The async response */ - public CompletableFuture delete(HrisEmployeesDeleteRequest request) { + public CompletableFuture delete(AccountingEmployeesDeleteRequest request) { return delete(request, Optional.empty()); } @@ -258,11 +249,11 @@ public CompletableFuture delete(HrisEmployeesDelete * * @param request The request object containing all the parameters for the API call. * @param options additional options - * @return {@code CompletableFuture} - The async response + * @return {@code CompletableFuture} - The async response */ - public CompletableFuture delete(HrisEmployeesDeleteRequest request, Optional options) { - AsyncRequestOperation operation - = new HrisEmployeesDelete.Async( + public CompletableFuture delete(AccountingEmployeesDeleteRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingEmployeesDelete.Async( sdkConfiguration, options, sdkConfiguration.retryScheduler(), _headers); return operation.doRequest(request) diff --git a/src/main/java/com/apideck/unify/AsyncExpenseCategories.java b/src/main/java/com/apideck/unify/AsyncExpenseCategories.java new file mode 100644 index 000000000..ee6ded575 --- /dev/null +++ b/src/main/java/com/apideck/unify/AsyncExpenseCategories.java @@ -0,0 +1,263 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAddRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAllRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesDeleteRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesOneRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesUpdateRequest; +import com.apideck.unify.models.operations.async.AccountingExpenseCategoriesAddRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingExpenseCategoriesAddResponse; +import com.apideck.unify.models.operations.async.AccountingExpenseCategoriesAllRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingExpenseCategoriesAllResponse; +import com.apideck.unify.models.operations.async.AccountingExpenseCategoriesDeleteRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingExpenseCategoriesDeleteResponse; +import com.apideck.unify.models.operations.async.AccountingExpenseCategoriesOneRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingExpenseCategoriesOneResponse; +import com.apideck.unify.models.operations.async.AccountingExpenseCategoriesUpdateRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingExpenseCategoriesUpdateResponse; +import com.apideck.unify.operations.AccountingExpenseCategoriesAdd; +import com.apideck.unify.operations.AccountingExpenseCategoriesAll; +import com.apideck.unify.operations.AccountingExpenseCategoriesDelete; +import com.apideck.unify.operations.AccountingExpenseCategoriesOne; +import com.apideck.unify.operations.AccountingExpenseCategoriesUpdate; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + + +public class AsyncExpenseCategories { + private static final Headers _headers = Headers.EMPTY; + private final SDKConfiguration sdkConfiguration; + private final ExpenseCategories syncSDK; + + AsyncExpenseCategories(ExpenseCategories syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public ExpenseCategories sync() { + return syncSDK; + } + + + /** + * List Expense Categories + * + *

List Expense Categories + * + * @return The async call builder + */ + public AccountingExpenseCategoriesAllRequestBuilder list() { + return new AccountingExpenseCategoriesAllRequestBuilder(sdkConfiguration); + } + + /** + * List Expense Categories + * + *

List Expense Categories + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture list(AccountingExpenseCategoriesAllRequest request) { + return list(request, Optional.empty()); + } + + /** + * List Expense Categories + * + *

List Expense Categories + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture list(AccountingExpenseCategoriesAllRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingExpenseCategoriesAll.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Create Expense Category + * + *

Create Expense Category + * + * @return The async call builder + */ + public AccountingExpenseCategoriesAddRequestBuilder create() { + return new AccountingExpenseCategoriesAddRequestBuilder(sdkConfiguration); + } + + /** + * Create Expense Category + * + *

Create Expense Category + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture create(AccountingExpenseCategoriesAddRequest request) { + return create(request, Optional.empty()); + } + + /** + * Create Expense Category + * + *

Create Expense Category + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture create(AccountingExpenseCategoriesAddRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingExpenseCategoriesAdd.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Expense Category + * + *

Get Expense Category + * + * @return The async call builder + */ + public AccountingExpenseCategoriesOneRequestBuilder get() { + return new AccountingExpenseCategoriesOneRequestBuilder(sdkConfiguration); + } + + /** + * Get Expense Category + * + *

Get Expense Category + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture get(AccountingExpenseCategoriesOneRequest request) { + return get(request, Optional.empty()); + } + + /** + * Get Expense Category + * + *

Get Expense Category + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture get(AccountingExpenseCategoriesOneRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingExpenseCategoriesOne.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Update Expense Category + * + *

Update Expense Category + * + * @return The async call builder + */ + public AccountingExpenseCategoriesUpdateRequestBuilder update() { + return new AccountingExpenseCategoriesUpdateRequestBuilder(sdkConfiguration); + } + + /** + * Update Expense Category + * + *

Update Expense Category + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture update(AccountingExpenseCategoriesUpdateRequest request) { + return update(request, Optional.empty()); + } + + /** + * Update Expense Category + * + *

Update Expense Category + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture update(AccountingExpenseCategoriesUpdateRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingExpenseCategoriesUpdate.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Delete Expense Category + * + *

Delete Expense Category + * + * @return The async call builder + */ + public AccountingExpenseCategoriesDeleteRequestBuilder delete() { + return new AccountingExpenseCategoriesDeleteRequestBuilder(sdkConfiguration); + } + + /** + * Delete Expense Category + * + *

Delete Expense Category + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture delete(AccountingExpenseCategoriesDeleteRequest request) { + return delete(request, Optional.empty()); + } + + /** + * Delete Expense Category + * + *

Delete Expense Category + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture delete(AccountingExpenseCategoriesDeleteRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingExpenseCategoriesDelete.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/com/apideck/unify/AsyncExpenseReports.java b/src/main/java/com/apideck/unify/AsyncExpenseReports.java new file mode 100644 index 000000000..5107c8d96 --- /dev/null +++ b/src/main/java/com/apideck/unify/AsyncExpenseReports.java @@ -0,0 +1,263 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.models.operations.AccountingExpenseReportsAddRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsAllRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsDeleteRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsOneRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsUpdateRequest; +import com.apideck.unify.models.operations.async.AccountingExpenseReportsAddRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingExpenseReportsAddResponse; +import com.apideck.unify.models.operations.async.AccountingExpenseReportsAllRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingExpenseReportsAllResponse; +import com.apideck.unify.models.operations.async.AccountingExpenseReportsDeleteRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingExpenseReportsDeleteResponse; +import com.apideck.unify.models.operations.async.AccountingExpenseReportsOneRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingExpenseReportsOneResponse; +import com.apideck.unify.models.operations.async.AccountingExpenseReportsUpdateRequestBuilder; +import com.apideck.unify.models.operations.async.AccountingExpenseReportsUpdateResponse; +import com.apideck.unify.operations.AccountingExpenseReportsAdd; +import com.apideck.unify.operations.AccountingExpenseReportsAll; +import com.apideck.unify.operations.AccountingExpenseReportsDelete; +import com.apideck.unify.operations.AccountingExpenseReportsOne; +import com.apideck.unify.operations.AccountingExpenseReportsUpdate; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + + +public class AsyncExpenseReports { + private static final Headers _headers = Headers.EMPTY; + private final SDKConfiguration sdkConfiguration; + private final ExpenseReports syncSDK; + + AsyncExpenseReports(ExpenseReports syncSDK, SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.syncSDK = syncSDK; + } + + /** + * Switches to the sync SDK. + * + * @return The sync SDK + */ + public ExpenseReports sync() { + return syncSDK; + } + + + /** + * List Expense Reports + * + *

List Expense Reports + * + * @return The async call builder + */ + public AccountingExpenseReportsAllRequestBuilder list() { + return new AccountingExpenseReportsAllRequestBuilder(sdkConfiguration); + } + + /** + * List Expense Reports + * + *

List Expense Reports + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture list(AccountingExpenseReportsAllRequest request) { + return list(request, Optional.empty()); + } + + /** + * List Expense Reports + * + *

List Expense Reports + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture list(AccountingExpenseReportsAllRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingExpenseReportsAll.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Create Expense Report + * + *

Create Expense Report + * + * @return The async call builder + */ + public AccountingExpenseReportsAddRequestBuilder create() { + return new AccountingExpenseReportsAddRequestBuilder(sdkConfiguration); + } + + /** + * Create Expense Report + * + *

Create Expense Report + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture create(AccountingExpenseReportsAddRequest request) { + return create(request, Optional.empty()); + } + + /** + * Create Expense Report + * + *

Create Expense Report + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture create(AccountingExpenseReportsAddRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingExpenseReportsAdd.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Get Expense Report + * + *

Get Expense Report + * + * @return The async call builder + */ + public AccountingExpenseReportsOneRequestBuilder get() { + return new AccountingExpenseReportsOneRequestBuilder(sdkConfiguration); + } + + /** + * Get Expense Report + * + *

Get Expense Report + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture get(AccountingExpenseReportsOneRequest request) { + return get(request, Optional.empty()); + } + + /** + * Get Expense Report + * + *

Get Expense Report + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture get(AccountingExpenseReportsOneRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingExpenseReportsOne.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Update Expense Report + * + *

Update Expense Report + * + * @return The async call builder + */ + public AccountingExpenseReportsUpdateRequestBuilder update() { + return new AccountingExpenseReportsUpdateRequestBuilder(sdkConfiguration); + } + + /** + * Update Expense Report + * + *

Update Expense Report + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture update(AccountingExpenseReportsUpdateRequest request) { + return update(request, Optional.empty()); + } + + /** + * Update Expense Report + * + *

Update Expense Report + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture update(AccountingExpenseReportsUpdateRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingExpenseReportsUpdate.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + + + /** + * Delete Expense Report + * + *

Delete Expense Report + * + * @return The async call builder + */ + public AccountingExpenseReportsDeleteRequestBuilder delete() { + return new AccountingExpenseReportsDeleteRequestBuilder(sdkConfiguration); + } + + /** + * Delete Expense Report + * + *

Delete Expense Report + * + * @param request The request object containing all the parameters for the API call. + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture delete(AccountingExpenseReportsDeleteRequest request) { + return delete(request, Optional.empty()); + } + + /** + * Delete Expense Report + * + *

Delete Expense Report + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return {@code CompletableFuture} - The async response + */ + public CompletableFuture delete(AccountingExpenseReportsDeleteRequest request, Optional options) { + AsyncRequestOperation operation + = new AccountingExpenseReportsDelete.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } + +} diff --git a/src/main/java/com/apideck/unify/AsyncHris.java b/src/main/java/com/apideck/unify/AsyncHris.java index ffa214a59..8d091c044 100644 --- a/src/main/java/com/apideck/unify/AsyncHris.java +++ b/src/main/java/com/apideck/unify/AsyncHris.java @@ -9,7 +9,7 @@ public class AsyncHris { private static final Headers _headers = Headers.EMPTY; private final SDKConfiguration sdkConfiguration; - private final AsyncEmployees employees; + private final AsyncApideckEmployees employees; private final AsyncApideckCompanies companies; private final AsyncApideckDepartments departments; private final AsyncPayrolls payrolls; @@ -20,7 +20,7 @@ public class AsyncHris { AsyncHris(Hris syncSDK, SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - this.employees = new AsyncEmployees(syncSDK.employees(), this.sdkConfiguration); + this.employees = new AsyncApideckEmployees(syncSDK.employees(), this.sdkConfiguration); this.companies = new AsyncApideckCompanies(syncSDK.companies(), this.sdkConfiguration); this.departments = new AsyncApideckDepartments(syncSDK.departments(), this.sdkConfiguration); this.payrolls = new AsyncPayrolls(syncSDK.payrolls(), this.sdkConfiguration); @@ -30,7 +30,7 @@ public class AsyncHris { this.syncSDK = syncSDK; } - public final AsyncEmployees employees() { + public final AsyncApideckEmployees employees() { return employees; } diff --git a/src/main/java/com/apideck/unify/Employees.java b/src/main/java/com/apideck/unify/Employees.java index d0432866f..0bd4221e8 100644 --- a/src/main/java/com/apideck/unify/Employees.java +++ b/src/main/java/com/apideck/unify/Employees.java @@ -5,26 +5,26 @@ import static com.apideck.unify.operations.Operations.RequestOperation; -import com.apideck.unify.models.operations.HrisEmployeesAddRequest; -import com.apideck.unify.models.operations.HrisEmployeesAddRequestBuilder; -import com.apideck.unify.models.operations.HrisEmployeesAddResponse; -import com.apideck.unify.models.operations.HrisEmployeesAllRequest; -import com.apideck.unify.models.operations.HrisEmployeesAllRequestBuilder; -import com.apideck.unify.models.operations.HrisEmployeesAllResponse; -import com.apideck.unify.models.operations.HrisEmployeesDeleteRequest; -import com.apideck.unify.models.operations.HrisEmployeesDeleteRequestBuilder; -import com.apideck.unify.models.operations.HrisEmployeesDeleteResponse; -import com.apideck.unify.models.operations.HrisEmployeesOneRequest; -import com.apideck.unify.models.operations.HrisEmployeesOneRequestBuilder; -import com.apideck.unify.models.operations.HrisEmployeesOneResponse; -import com.apideck.unify.models.operations.HrisEmployeesUpdateRequest; -import com.apideck.unify.models.operations.HrisEmployeesUpdateRequestBuilder; -import com.apideck.unify.models.operations.HrisEmployeesUpdateResponse; -import com.apideck.unify.operations.HrisEmployeesAdd; -import com.apideck.unify.operations.HrisEmployeesAll; -import com.apideck.unify.operations.HrisEmployeesDelete; -import com.apideck.unify.operations.HrisEmployeesOne; -import com.apideck.unify.operations.HrisEmployeesUpdate; +import com.apideck.unify.models.operations.AccountingEmployeesAddRequest; +import com.apideck.unify.models.operations.AccountingEmployeesAddRequestBuilder; +import com.apideck.unify.models.operations.AccountingEmployeesAddResponse; +import com.apideck.unify.models.operations.AccountingEmployeesAllRequest; +import com.apideck.unify.models.operations.AccountingEmployeesAllRequestBuilder; +import com.apideck.unify.models.operations.AccountingEmployeesAllResponse; +import com.apideck.unify.models.operations.AccountingEmployeesDeleteRequest; +import com.apideck.unify.models.operations.AccountingEmployeesDeleteRequestBuilder; +import com.apideck.unify.models.operations.AccountingEmployeesDeleteResponse; +import com.apideck.unify.models.operations.AccountingEmployeesOneRequest; +import com.apideck.unify.models.operations.AccountingEmployeesOneRequestBuilder; +import com.apideck.unify.models.operations.AccountingEmployeesOneResponse; +import com.apideck.unify.models.operations.AccountingEmployeesUpdateRequest; +import com.apideck.unify.models.operations.AccountingEmployeesUpdateRequestBuilder; +import com.apideck.unify.models.operations.AccountingEmployeesUpdateResponse; +import com.apideck.unify.operations.AccountingEmployeesAdd; +import com.apideck.unify.operations.AccountingEmployeesAll; +import com.apideck.unify.operations.AccountingEmployeesDelete; +import com.apideck.unify.operations.AccountingEmployeesOne; +import com.apideck.unify.operations.AccountingEmployeesUpdate; import com.apideck.unify.utils.Headers; import com.apideck.unify.utils.Options; import java.util.Optional; @@ -52,49 +52,40 @@ public AsyncEmployees async() { /** * List Employees * - *

Apideck operates as a stateless Unified API, which means that the list endpoint only provides a - * portion of the employee model. This is due to the fact that most HRIS systems do not readily provide - * all data in every call. However, you can access the complete employee model through an employee - * detail call. + *

List Employees * * @return The call builder */ - public HrisEmployeesAllRequestBuilder list() { - return new HrisEmployeesAllRequestBuilder(sdkConfiguration); + public AccountingEmployeesAllRequestBuilder list() { + return new AccountingEmployeesAllRequestBuilder(sdkConfiguration); } /** * List Employees * - *

Apideck operates as a stateless Unified API, which means that the list endpoint only provides a - * portion of the employee model. This is due to the fact that most HRIS systems do not readily provide - * all data in every call. However, you can access the complete employee model through an employee - * detail call. + *

List Employees * * @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 HrisEmployeesAllResponse list(HrisEmployeesAllRequest request) { + public AccountingEmployeesAllResponse list(AccountingEmployeesAllRequest request) { return list(request, Optional.empty()); } /** * List Employees * - *

Apideck operates as a stateless Unified API, which means that the list endpoint only provides a - * portion of the employee model. This is due to the fact that most HRIS systems do not readily provide - * all data in every call. However, you can access the complete employee model through an employee - * detail call. + *

List Employees * * @param request The request object containing all the parameters for the API call. * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ - public HrisEmployeesAllResponse list(HrisEmployeesAllRequest request, Optional options) { - RequestOperation operation - = new HrisEmployeesAll.Sync(sdkConfiguration, options, _headers); + public AccountingEmployeesAllResponse list(AccountingEmployeesAllRequest request, Optional options) { + RequestOperation operation + = new AccountingEmployeesAll.Sync(sdkConfiguration, options, _headers); return operation.handleResponse(operation.doRequest(request)); } @@ -105,8 +96,8 @@ public HrisEmployeesAllResponse list(HrisEmployeesAllRequest request, Optional options) { - RequestOperation operation - = new HrisEmployeesAdd.Sync(sdkConfiguration, options, _headers); + public AccountingEmployeesAddResponse create(AccountingEmployeesAddRequest request, Optional options) { + RequestOperation operation + = new AccountingEmployeesAdd.Sync(sdkConfiguration, options, _headers); return operation.handleResponse(operation.doRequest(request)); } @@ -145,8 +136,8 @@ public HrisEmployeesAddResponse create(HrisEmployeesAddRequest request, Optional * * @return The call builder */ - public HrisEmployeesOneRequestBuilder get() { - return new HrisEmployeesOneRequestBuilder(sdkConfiguration); + public AccountingEmployeesOneRequestBuilder get() { + return new AccountingEmployeesOneRequestBuilder(sdkConfiguration); } /** @@ -158,7 +149,7 @@ public HrisEmployeesOneRequestBuilder get() { * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ - public HrisEmployeesOneResponse get(HrisEmployeesOneRequest request) { + public AccountingEmployeesOneResponse get(AccountingEmployeesOneRequest request) { return get(request, Optional.empty()); } @@ -172,9 +163,9 @@ public HrisEmployeesOneResponse get(HrisEmployeesOneRequest request) { * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ - public HrisEmployeesOneResponse get(HrisEmployeesOneRequest request, Optional options) { - RequestOperation operation - = new HrisEmployeesOne.Sync(sdkConfiguration, options, _headers); + public AccountingEmployeesOneResponse get(AccountingEmployeesOneRequest request, Optional options) { + RequestOperation operation + = new AccountingEmployeesOne.Sync(sdkConfiguration, options, _headers); return operation.handleResponse(operation.doRequest(request)); } @@ -185,8 +176,8 @@ public HrisEmployeesOneResponse get(HrisEmployeesOneRequest request, Optional options) { - RequestOperation operation - = new HrisEmployeesUpdate.Sync(sdkConfiguration, options, _headers); + public AccountingEmployeesUpdateResponse update(AccountingEmployeesUpdateRequest request, Optional options) { + RequestOperation operation + = new AccountingEmployeesUpdate.Sync(sdkConfiguration, options, _headers); return operation.handleResponse(operation.doRequest(request)); } @@ -225,8 +216,8 @@ public HrisEmployeesUpdateResponse update(HrisEmployeesUpdateRequest request, Op * * @return The call builder */ - public HrisEmployeesDeleteRequestBuilder delete() { - return new HrisEmployeesDeleteRequestBuilder(sdkConfiguration); + public AccountingEmployeesDeleteRequestBuilder delete() { + return new AccountingEmployeesDeleteRequestBuilder(sdkConfiguration); } /** @@ -238,7 +229,7 @@ public HrisEmployeesDeleteRequestBuilder delete() { * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ - public HrisEmployeesDeleteResponse delete(HrisEmployeesDeleteRequest request) { + public AccountingEmployeesDeleteResponse delete(AccountingEmployeesDeleteRequest request) { return delete(request, Optional.empty()); } @@ -252,9 +243,9 @@ public HrisEmployeesDeleteResponse delete(HrisEmployeesDeleteRequest request) { * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ - public HrisEmployeesDeleteResponse delete(HrisEmployeesDeleteRequest request, Optional options) { - RequestOperation operation - = new HrisEmployeesDelete.Sync(sdkConfiguration, options, _headers); + public AccountingEmployeesDeleteResponse delete(AccountingEmployeesDeleteRequest request, Optional options) { + RequestOperation operation + = new AccountingEmployeesDelete.Sync(sdkConfiguration, options, _headers); return operation.handleResponse(operation.doRequest(request)); } diff --git a/src/main/java/com/apideck/unify/ExpenseCategories.java b/src/main/java/com/apideck/unify/ExpenseCategories.java new file mode 100644 index 000000000..f9c9cdfc3 --- /dev/null +++ b/src/main/java/com/apideck/unify/ExpenseCategories.java @@ -0,0 +1,252 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAddRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAddRequestBuilder; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAddResponse; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAllRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAllRequestBuilder; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAllResponse; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesDeleteRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesDeleteRequestBuilder; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesDeleteResponse; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesOneRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesOneRequestBuilder; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesOneResponse; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesUpdateRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesUpdateRequestBuilder; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesUpdateResponse; +import com.apideck.unify.operations.AccountingExpenseCategoriesAdd; +import com.apideck.unify.operations.AccountingExpenseCategoriesAll; +import com.apideck.unify.operations.AccountingExpenseCategoriesDelete; +import com.apideck.unify.operations.AccountingExpenseCategoriesOne; +import com.apideck.unify.operations.AccountingExpenseCategoriesUpdate; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import java.util.Optional; + + +public class ExpenseCategories { + private static final Headers _headers = Headers.EMPTY; + private final SDKConfiguration sdkConfiguration; + private final AsyncExpenseCategories asyncSDK; + + ExpenseCategories(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncExpenseCategories(this, sdkConfiguration); + } + + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncExpenseCategories async() { + return asyncSDK; + } + + /** + * List Expense Categories + * + *

List Expense Categories + * + * @return The call builder + */ + public AccountingExpenseCategoriesAllRequestBuilder list() { + return new AccountingExpenseCategoriesAllRequestBuilder(sdkConfiguration); + } + + /** + * List Expense Categories + * + *

List Expense Categories + * + * @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 AccountingExpenseCategoriesAllResponse list(AccountingExpenseCategoriesAllRequest request) { + return list(request, Optional.empty()); + } + + /** + * List Expense Categories + * + *

List Expense Categories + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public AccountingExpenseCategoriesAllResponse list(AccountingExpenseCategoriesAllRequest request, Optional options) { + RequestOperation operation + = new AccountingExpenseCategoriesAll.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Create Expense Category + * + *

Create Expense Category + * + * @return The call builder + */ + public AccountingExpenseCategoriesAddRequestBuilder create() { + return new AccountingExpenseCategoriesAddRequestBuilder(sdkConfiguration); + } + + /** + * Create Expense Category + * + *

Create Expense Category + * + * @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 AccountingExpenseCategoriesAddResponse create(AccountingExpenseCategoriesAddRequest request) { + return create(request, Optional.empty()); + } + + /** + * Create Expense Category + * + *

Create Expense Category + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public AccountingExpenseCategoriesAddResponse create(AccountingExpenseCategoriesAddRequest request, Optional options) { + RequestOperation operation + = new AccountingExpenseCategoriesAdd.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Get Expense Category + * + *

Get Expense Category + * + * @return The call builder + */ + public AccountingExpenseCategoriesOneRequestBuilder get() { + return new AccountingExpenseCategoriesOneRequestBuilder(sdkConfiguration); + } + + /** + * Get Expense Category + * + *

Get Expense Category + * + * @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 AccountingExpenseCategoriesOneResponse get(AccountingExpenseCategoriesOneRequest request) { + return get(request, Optional.empty()); + } + + /** + * Get Expense Category + * + *

Get Expense Category + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public AccountingExpenseCategoriesOneResponse get(AccountingExpenseCategoriesOneRequest request, Optional options) { + RequestOperation operation + = new AccountingExpenseCategoriesOne.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Update Expense Category + * + *

Update Expense Category + * + * @return The call builder + */ + public AccountingExpenseCategoriesUpdateRequestBuilder update() { + return new AccountingExpenseCategoriesUpdateRequestBuilder(sdkConfiguration); + } + + /** + * Update Expense Category + * + *

Update Expense Category + * + * @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 AccountingExpenseCategoriesUpdateResponse update(AccountingExpenseCategoriesUpdateRequest request) { + return update(request, Optional.empty()); + } + + /** + * Update Expense Category + * + *

Update Expense Category + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public AccountingExpenseCategoriesUpdateResponse update(AccountingExpenseCategoriesUpdateRequest request, Optional options) { + RequestOperation operation + = new AccountingExpenseCategoriesUpdate.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Delete Expense Category + * + *

Delete Expense Category + * + * @return The call builder + */ + public AccountingExpenseCategoriesDeleteRequestBuilder delete() { + return new AccountingExpenseCategoriesDeleteRequestBuilder(sdkConfiguration); + } + + /** + * Delete Expense Category + * + *

Delete Expense Category + * + * @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 AccountingExpenseCategoriesDeleteResponse delete(AccountingExpenseCategoriesDeleteRequest request) { + return delete(request, Optional.empty()); + } + + /** + * Delete Expense Category + * + *

Delete Expense Category + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public AccountingExpenseCategoriesDeleteResponse delete(AccountingExpenseCategoriesDeleteRequest request, Optional options) { + RequestOperation operation + = new AccountingExpenseCategoriesDelete.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + +} diff --git a/src/main/java/com/apideck/unify/ExpenseReports.java b/src/main/java/com/apideck/unify/ExpenseReports.java new file mode 100644 index 000000000..84827b266 --- /dev/null +++ b/src/main/java/com/apideck/unify/ExpenseReports.java @@ -0,0 +1,252 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.models.operations.AccountingExpenseReportsAddRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsAddRequestBuilder; +import com.apideck.unify.models.operations.AccountingExpenseReportsAddResponse; +import com.apideck.unify.models.operations.AccountingExpenseReportsAllRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsAllRequestBuilder; +import com.apideck.unify.models.operations.AccountingExpenseReportsAllResponse; +import com.apideck.unify.models.operations.AccountingExpenseReportsDeleteRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsDeleteRequestBuilder; +import com.apideck.unify.models.operations.AccountingExpenseReportsDeleteResponse; +import com.apideck.unify.models.operations.AccountingExpenseReportsOneRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsOneRequestBuilder; +import com.apideck.unify.models.operations.AccountingExpenseReportsOneResponse; +import com.apideck.unify.models.operations.AccountingExpenseReportsUpdateRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsUpdateRequestBuilder; +import com.apideck.unify.models.operations.AccountingExpenseReportsUpdateResponse; +import com.apideck.unify.operations.AccountingExpenseReportsAdd; +import com.apideck.unify.operations.AccountingExpenseReportsAll; +import com.apideck.unify.operations.AccountingExpenseReportsDelete; +import com.apideck.unify.operations.AccountingExpenseReportsOne; +import com.apideck.unify.operations.AccountingExpenseReportsUpdate; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import java.util.Optional; + + +public class ExpenseReports { + private static final Headers _headers = Headers.EMPTY; + private final SDKConfiguration sdkConfiguration; + private final AsyncExpenseReports asyncSDK; + + ExpenseReports(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + this.asyncSDK = new AsyncExpenseReports(this, sdkConfiguration); + } + + /** + * Switches to the async SDK. + * + * @return The async SDK + */ + public AsyncExpenseReports async() { + return asyncSDK; + } + + /** + * List Expense Reports + * + *

List Expense Reports + * + * @return The call builder + */ + public AccountingExpenseReportsAllRequestBuilder list() { + return new AccountingExpenseReportsAllRequestBuilder(sdkConfiguration); + } + + /** + * List Expense Reports + * + *

List Expense Reports + * + * @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 AccountingExpenseReportsAllResponse list(AccountingExpenseReportsAllRequest request) { + return list(request, Optional.empty()); + } + + /** + * List Expense Reports + * + *

List Expense Reports + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public AccountingExpenseReportsAllResponse list(AccountingExpenseReportsAllRequest request, Optional options) { + RequestOperation operation + = new AccountingExpenseReportsAll.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Create Expense Report + * + *

Create Expense Report + * + * @return The call builder + */ + public AccountingExpenseReportsAddRequestBuilder create() { + return new AccountingExpenseReportsAddRequestBuilder(sdkConfiguration); + } + + /** + * Create Expense Report + * + *

Create Expense Report + * + * @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 AccountingExpenseReportsAddResponse create(AccountingExpenseReportsAddRequest request) { + return create(request, Optional.empty()); + } + + /** + * Create Expense Report + * + *

Create Expense Report + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public AccountingExpenseReportsAddResponse create(AccountingExpenseReportsAddRequest request, Optional options) { + RequestOperation operation + = new AccountingExpenseReportsAdd.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Get Expense Report + * + *

Get Expense Report + * + * @return The call builder + */ + public AccountingExpenseReportsOneRequestBuilder get() { + return new AccountingExpenseReportsOneRequestBuilder(sdkConfiguration); + } + + /** + * Get Expense Report + * + *

Get Expense Report + * + * @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 AccountingExpenseReportsOneResponse get(AccountingExpenseReportsOneRequest request) { + return get(request, Optional.empty()); + } + + /** + * Get Expense Report + * + *

Get Expense Report + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public AccountingExpenseReportsOneResponse get(AccountingExpenseReportsOneRequest request, Optional options) { + RequestOperation operation + = new AccountingExpenseReportsOne.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Update Expense Report + * + *

Update Expense Report + * + * @return The call builder + */ + public AccountingExpenseReportsUpdateRequestBuilder update() { + return new AccountingExpenseReportsUpdateRequestBuilder(sdkConfiguration); + } + + /** + * Update Expense Report + * + *

Update Expense Report + * + * @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 AccountingExpenseReportsUpdateResponse update(AccountingExpenseReportsUpdateRequest request) { + return update(request, Optional.empty()); + } + + /** + * Update Expense Report + * + *

Update Expense Report + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public AccountingExpenseReportsUpdateResponse update(AccountingExpenseReportsUpdateRequest request, Optional options) { + RequestOperation operation + = new AccountingExpenseReportsUpdate.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + + /** + * Delete Expense Report + * + *

Delete Expense Report + * + * @return The call builder + */ + public AccountingExpenseReportsDeleteRequestBuilder delete() { + return new AccountingExpenseReportsDeleteRequestBuilder(sdkConfiguration); + } + + /** + * Delete Expense Report + * + *

Delete Expense Report + * + * @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 AccountingExpenseReportsDeleteResponse delete(AccountingExpenseReportsDeleteRequest request) { + return delete(request, Optional.empty()); + } + + /** + * Delete Expense Report + * + *

Delete Expense Report + * + * @param request The request object containing all the parameters for the API call. + * @param options additional options + * @return The response from the API call + * @throws RuntimeException subclass if the API call fails + */ + public AccountingExpenseReportsDeleteResponse delete(AccountingExpenseReportsDeleteRequest request, Optional options) { + RequestOperation operation + = new AccountingExpenseReportsDelete.Sync(sdkConfiguration, options, _headers); + return operation.handleResponse(operation.doRequest(request)); + } + +} diff --git a/src/main/java/com/apideck/unify/Hris.java b/src/main/java/com/apideck/unify/Hris.java index 6f8f5fa3d..8373ccc8c 100644 --- a/src/main/java/com/apideck/unify/Hris.java +++ b/src/main/java/com/apideck/unify/Hris.java @@ -10,7 +10,7 @@ public class Hris { private static final Headers _headers = Headers.EMPTY; private final SDKConfiguration sdkConfiguration; private final AsyncHris asyncSDK; - private final Employees employees; + private final ApideckEmployees employees; private final ApideckCompanies companies; private final ApideckDepartments departments; private final Payrolls payrolls; @@ -20,7 +20,7 @@ public class Hris { Hris(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - this.employees = new Employees(this.sdkConfiguration); + this.employees = new ApideckEmployees(this.sdkConfiguration); this.companies = new ApideckCompanies(this.sdkConfiguration); this.departments = new ApideckDepartments(this.sdkConfiguration); this.payrolls = new Payrolls(this.sdkConfiguration); @@ -30,7 +30,7 @@ public class Hris { this.asyncSDK = new AsyncHris(this, sdkConfiguration); } - public final Employees employees() { + public final ApideckEmployees employees() { return employees; } diff --git a/src/main/java/com/apideck/unify/SDKConfiguration.java b/src/main/java/com/apideck/unify/SDKConfiguration.java index 1453c8f68..0a63d8043 100644 --- a/src/main/java/com/apideck/unify/SDKConfiguration.java +++ b/src/main/java/com/apideck/unify/SDKConfiguration.java @@ -20,9 +20,9 @@ public class SDKConfiguration { private static final String LANGUAGE = "java"; - public static final String OPENAPI_DOC_VERSION = "10.23.19"; - public static final String SDK_VERSION = "0.30.3"; - public static final String GEN_VERSION = "2.824.1"; + public static final String OPENAPI_DOC_VERSION = "10.23.21"; + public static final String SDK_VERSION = "0.30.4"; + public static final String GEN_VERSION = "2.836.5"; private static final String BASE_PACKAGE = "com.apideck.unify"; public static final String USER_AGENT = String.format("speakeasy-sdk/%s %s %s %s %s", diff --git a/src/main/java/com/apideck/unify/models/components/AccountingEmployee.java b/src/main/java/com/apideck/unify/models/components/AccountingEmployee.java new file mode 100644 index 000000000..1913295fa --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/AccountingEmployee.java @@ -0,0 +1,1844 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Boolean; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingEmployee { + /** + * A unique identifier for an object. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The third-party API ID of original entity + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("downstream_id") + private JsonNullable downstreamId; + + /** + * Id to be displayed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("display_id") + private JsonNullable displayId; + + /** + * The first name of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("first_name") + private JsonNullable firstName; + + /** + * The last name of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_name") + private JsonNullable lastName; + + /** + * The display name of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("display_name") + private JsonNullable displayName; + + /** + * Email addresses of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("emails") + private Optional> emails; + + /** + * The employee number or identifier. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("employee_number") + private JsonNullable employeeNumber; + + /** + * The job title of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("job_title") + private JsonNullable jobTitle; + + /** + * The status of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private JsonNullable status; + + /** + * Whether the employee is a contractor. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("is_contractor") + private JsonNullable isContractor; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("department") + private JsonNullable department; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("location") + private JsonNullable location; + + /** + * The manager of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("manager") + private Optional manager; + + /** + * The date the employee was hired. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("hire_date") + private JsonNullable hireDate; + + /** + * The date the employee was terminated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("termination_date") + private JsonNullable terminationDate; + + /** + * The gender represents the gender identity of a person. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("gender") + private JsonNullable gender; + + /** + * The date of birth of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("birth_date") + private JsonNullable birthDate; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subsidiary") + private JsonNullable subsidiary; + + /** + * A list of linked tracking categories. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tracking_categories") + private JsonNullable> trackingCategories; + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private JsonNullable currency; + + /** + * Notes about the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("notes") + private JsonNullable notes; + + /** + * Addresses of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("addresses") + private Optional> addresses; + + /** + * Phone numbers of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("phone_numbers") + private Optional> phoneNumbers; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("custom_fields") + private Optional> customFields; + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("custom_mappings") + private JsonNullable> customMappings; + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("row_version") + private JsonNullable rowVersion; + + /** + * The date and time when the object was last updated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("updated_at") + private JsonNullable updatedAt; + + /** + * The date and time when the object was created. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_at") + private JsonNullable createdAt; + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("pass_through") + private Optional> passThrough; + + @JsonCreator + public AccountingEmployee( + @JsonProperty("id") Optional id, + @JsonProperty("downstream_id") JsonNullable downstreamId, + @JsonProperty("display_id") JsonNullable displayId, + @JsonProperty("first_name") JsonNullable firstName, + @JsonProperty("last_name") JsonNullable lastName, + @JsonProperty("display_name") JsonNullable displayName, + @JsonProperty("emails") Optional> emails, + @JsonProperty("employee_number") JsonNullable employeeNumber, + @JsonProperty("job_title") JsonNullable jobTitle, + @JsonProperty("status") JsonNullable status, + @JsonProperty("is_contractor") JsonNullable isContractor, + @JsonProperty("department") JsonNullable department, + @JsonProperty("location") JsonNullable location, + @JsonProperty("manager") Optional manager, + @JsonProperty("hire_date") JsonNullable hireDate, + @JsonProperty("termination_date") JsonNullable terminationDate, + @JsonProperty("gender") JsonNullable gender, + @JsonProperty("birth_date") JsonNullable birthDate, + @JsonProperty("subsidiary") JsonNullable subsidiary, + @JsonProperty("tracking_categories") JsonNullable> trackingCategories, + @JsonProperty("currency") JsonNullable currency, + @JsonProperty("notes") JsonNullable notes, + @JsonProperty("addresses") Optional> addresses, + @JsonProperty("phone_numbers") Optional> phoneNumbers, + @JsonProperty("custom_fields") Optional> customFields, + @JsonProperty("custom_mappings") JsonNullable> customMappings, + @JsonProperty("row_version") JsonNullable rowVersion, + @JsonProperty("updated_at") JsonNullable updatedAt, + @JsonProperty("created_at") JsonNullable createdAt, + @JsonProperty("pass_through") Optional> passThrough) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(downstreamId, "downstreamId"); + Utils.checkNotNull(displayId, "displayId"); + Utils.checkNotNull(firstName, "firstName"); + Utils.checkNotNull(lastName, "lastName"); + Utils.checkNotNull(displayName, "displayName"); + Utils.checkNotNull(emails, "emails"); + Utils.checkNotNull(employeeNumber, "employeeNumber"); + Utils.checkNotNull(jobTitle, "jobTitle"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(isContractor, "isContractor"); + Utils.checkNotNull(department, "department"); + Utils.checkNotNull(location, "location"); + Utils.checkNotNull(manager, "manager"); + Utils.checkNotNull(hireDate, "hireDate"); + Utils.checkNotNull(terminationDate, "terminationDate"); + Utils.checkNotNull(gender, "gender"); + Utils.checkNotNull(birthDate, "birthDate"); + Utils.checkNotNull(subsidiary, "subsidiary"); + Utils.checkNotNull(trackingCategories, "trackingCategories"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(notes, "notes"); + Utils.checkNotNull(addresses, "addresses"); + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + Utils.checkNotNull(customFields, "customFields"); + Utils.checkNotNull(customMappings, "customMappings"); + Utils.checkNotNull(rowVersion, "rowVersion"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(passThrough, "passThrough"); + this.id = id; + this.downstreamId = downstreamId; + this.displayId = displayId; + this.firstName = firstName; + this.lastName = lastName; + this.displayName = displayName; + this.emails = emails; + this.employeeNumber = employeeNumber; + this.jobTitle = jobTitle; + this.status = status; + this.isContractor = isContractor; + this.department = department; + this.location = location; + this.manager = manager; + this.hireDate = hireDate; + this.terminationDate = terminationDate; + this.gender = gender; + this.birthDate = birthDate; + this.subsidiary = subsidiary; + this.trackingCategories = trackingCategories; + this.currency = currency; + this.notes = notes; + this.addresses = addresses; + this.phoneNumbers = phoneNumbers; + this.customFields = customFields; + this.customMappings = customMappings; + this.rowVersion = rowVersion; + this.updatedAt = updatedAt; + this.createdAt = createdAt; + this.passThrough = passThrough; + } + + public AccountingEmployee() { + this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), Optional.empty(), Optional.empty(), + Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + } + + /** + * A unique identifier for an object. + */ + @JsonIgnore + public Optional id() { + return id; + } + + /** + * The third-party API ID of original entity + */ + @JsonIgnore + public JsonNullable downstreamId() { + return downstreamId; + } + + /** + * Id to be displayed. + */ + @JsonIgnore + public JsonNullable displayId() { + return displayId; + } + + /** + * The first name of the employee. + */ + @JsonIgnore + public JsonNullable firstName() { + return firstName; + } + + /** + * The last name of the employee. + */ + @JsonIgnore + public JsonNullable lastName() { + return lastName; + } + + /** + * The display name of the employee. + */ + @JsonIgnore + public JsonNullable displayName() { + return displayName; + } + + /** + * Email addresses of the employee. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> emails() { + return (Optional>) emails; + } + + /** + * The employee number or identifier. + */ + @JsonIgnore + public JsonNullable employeeNumber() { + return employeeNumber; + } + + /** + * The job title of the employee. + */ + @JsonIgnore + public JsonNullable jobTitle() { + return jobTitle; + } + + /** + * The status of the employee. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable status() { + return (JsonNullable) status; + } + + /** + * Whether the employee is a contractor. + */ + @JsonIgnore + public JsonNullable isContractor() { + return isContractor; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable department() { + return (JsonNullable) department; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable location() { + return (JsonNullable) location; + } + + /** + * The manager of the employee. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional manager() { + return (Optional) manager; + } + + /** + * The date the employee was hired. + */ + @JsonIgnore + public JsonNullable hireDate() { + return hireDate; + } + + /** + * The date the employee was terminated. + */ + @JsonIgnore + public JsonNullable terminationDate() { + return terminationDate; + } + + /** + * The gender represents the gender identity of a person. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable gender() { + return (JsonNullable) gender; + } + + /** + * The date of birth of the employee. + */ + @JsonIgnore + public JsonNullable birthDate() { + return birthDate; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable subsidiary() { + return (JsonNullable) subsidiary; + } + + /** + * A list of linked tracking categories. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> trackingCategories() { + return (JsonNullable>) trackingCategories; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable currency() { + return (JsonNullable) currency; + } + + /** + * Notes about the employee. + */ + @JsonIgnore + public JsonNullable notes() { + return notes; + } + + /** + * Addresses of the employee. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> addresses() { + return (Optional>) addresses; + } + + /** + * Phone numbers of the employee. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> phoneNumbers() { + return (Optional>) phoneNumbers; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> customFields() { + return (Optional>) customFields; + } + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> customMappings() { + return (JsonNullable>) customMappings; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + @JsonIgnore + public JsonNullable rowVersion() { + return rowVersion; + } + + /** + * The date and time when the object was last updated. + */ + @JsonIgnore + public JsonNullable updatedAt() { + return updatedAt; + } + + /** + * The date and time when the object was created. + */ + @JsonIgnore + public JsonNullable createdAt() { + return createdAt; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> passThrough() { + return (Optional>) passThrough; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * A unique identifier for an object. + */ + public AccountingEmployee withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + + /** + * A unique identifier for an object. + */ + public AccountingEmployee withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The third-party API ID of original entity + */ + public AccountingEmployee withDownstreamId(String downstreamId) { + Utils.checkNotNull(downstreamId, "downstreamId"); + this.downstreamId = JsonNullable.of(downstreamId); + return this; + } + + /** + * The third-party API ID of original entity + */ + public AccountingEmployee withDownstreamId(JsonNullable downstreamId) { + Utils.checkNotNull(downstreamId, "downstreamId"); + this.downstreamId = downstreamId; + return this; + } + + /** + * Id to be displayed. + */ + public AccountingEmployee withDisplayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public AccountingEmployee withDisplayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + /** + * The first name of the employee. + */ + public AccountingEmployee withFirstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + /** + * The first name of the employee. + */ + public AccountingEmployee withFirstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + /** + * The last name of the employee. + */ + public AccountingEmployee withLastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + /** + * The last name of the employee. + */ + public AccountingEmployee withLastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + /** + * The display name of the employee. + */ + public AccountingEmployee withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = JsonNullable.of(displayName); + return this; + } + + /** + * The display name of the employee. + */ + public AccountingEmployee withDisplayName(JsonNullable displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + /** + * Email addresses of the employee. + */ + public AccountingEmployee withEmails(List emails) { + Utils.checkNotNull(emails, "emails"); + this.emails = Optional.ofNullable(emails); + return this; + } + + + /** + * Email addresses of the employee. + */ + public AccountingEmployee withEmails(Optional> emails) { + Utils.checkNotNull(emails, "emails"); + this.emails = emails; + return this; + } + + /** + * The employee number or identifier. + */ + public AccountingEmployee withEmployeeNumber(String employeeNumber) { + Utils.checkNotNull(employeeNumber, "employeeNumber"); + this.employeeNumber = JsonNullable.of(employeeNumber); + return this; + } + + /** + * The employee number or identifier. + */ + public AccountingEmployee withEmployeeNumber(JsonNullable employeeNumber) { + Utils.checkNotNull(employeeNumber, "employeeNumber"); + this.employeeNumber = employeeNumber; + return this; + } + + /** + * The job title of the employee. + */ + public AccountingEmployee withJobTitle(String jobTitle) { + Utils.checkNotNull(jobTitle, "jobTitle"); + this.jobTitle = JsonNullable.of(jobTitle); + return this; + } + + /** + * The job title of the employee. + */ + public AccountingEmployee withJobTitle(JsonNullable jobTitle) { + Utils.checkNotNull(jobTitle, "jobTitle"); + this.jobTitle = jobTitle; + return this; + } + + /** + * The status of the employee. + */ + public AccountingEmployee withStatus(EmployeeStatus status) { + Utils.checkNotNull(status, "status"); + this.status = JsonNullable.of(status); + return this; + } + + /** + * The status of the employee. + */ + public AccountingEmployee withStatus(JsonNullable status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Whether the employee is a contractor. + */ + public AccountingEmployee withIsContractor(boolean isContractor) { + Utils.checkNotNull(isContractor, "isContractor"); + this.isContractor = JsonNullable.of(isContractor); + return this; + } + + /** + * Whether the employee is a contractor. + */ + public AccountingEmployee withIsContractor(JsonNullable isContractor) { + Utils.checkNotNull(isContractor, "isContractor"); + this.isContractor = isContractor; + return this; + } + + public AccountingEmployee withDepartment(LinkedDepartment department) { + Utils.checkNotNull(department, "department"); + this.department = JsonNullable.of(department); + return this; + } + + public AccountingEmployee withDepartment(JsonNullable department) { + Utils.checkNotNull(department, "department"); + this.department = department; + return this; + } + + public AccountingEmployee withLocation(LinkedLocation location) { + Utils.checkNotNull(location, "location"); + this.location = JsonNullable.of(location); + return this; + } + + public AccountingEmployee withLocation(JsonNullable location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + /** + * The manager of the employee. + */ + public AccountingEmployee withManager(AccountingEmployeeManager manager) { + Utils.checkNotNull(manager, "manager"); + this.manager = Optional.ofNullable(manager); + return this; + } + + + /** + * The manager of the employee. + */ + public AccountingEmployee withManager(Optional manager) { + Utils.checkNotNull(manager, "manager"); + this.manager = manager; + return this; + } + + /** + * The date the employee was hired. + */ + public AccountingEmployee withHireDate(LocalDate hireDate) { + Utils.checkNotNull(hireDate, "hireDate"); + this.hireDate = JsonNullable.of(hireDate); + return this; + } + + /** + * The date the employee was hired. + */ + public AccountingEmployee withHireDate(JsonNullable hireDate) { + Utils.checkNotNull(hireDate, "hireDate"); + this.hireDate = hireDate; + return this; + } + + /** + * The date the employee was terminated. + */ + public AccountingEmployee withTerminationDate(LocalDate terminationDate) { + Utils.checkNotNull(terminationDate, "terminationDate"); + this.terminationDate = JsonNullable.of(terminationDate); + return this; + } + + /** + * The date the employee was terminated. + */ + public AccountingEmployee withTerminationDate(JsonNullable terminationDate) { + Utils.checkNotNull(terminationDate, "terminationDate"); + this.terminationDate = terminationDate; + return this; + } + + /** + * The gender represents the gender identity of a person. + */ + public AccountingEmployee withGender(Gender gender) { + Utils.checkNotNull(gender, "gender"); + this.gender = JsonNullable.of(gender); + return this; + } + + /** + * The gender represents the gender identity of a person. + */ + public AccountingEmployee withGender(JsonNullable gender) { + Utils.checkNotNull(gender, "gender"); + this.gender = gender; + return this; + } + + /** + * The date of birth of the employee. + */ + public AccountingEmployee withBirthDate(LocalDate birthDate) { + Utils.checkNotNull(birthDate, "birthDate"); + this.birthDate = JsonNullable.of(birthDate); + return this; + } + + /** + * The date of birth of the employee. + */ + public AccountingEmployee withBirthDate(JsonNullable birthDate) { + Utils.checkNotNull(birthDate, "birthDate"); + this.birthDate = birthDate; + return this; + } + + public AccountingEmployee withSubsidiary(LinkedSubsidiary subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = JsonNullable.of(subsidiary); + return this; + } + + public AccountingEmployee withSubsidiary(JsonNullable subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = subsidiary; + return this; + } + + /** + * A list of linked tracking categories. + */ + public AccountingEmployee withTrackingCategories(List trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = JsonNullable.of(trackingCategories); + return this; + } + + /** + * A list of linked tracking categories. + */ + public AccountingEmployee withTrackingCategories(JsonNullable> trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = trackingCategories; + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public AccountingEmployee withCurrency(Currency currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public AccountingEmployee withCurrency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Notes about the employee. + */ + public AccountingEmployee withNotes(String notes) { + Utils.checkNotNull(notes, "notes"); + this.notes = JsonNullable.of(notes); + return this; + } + + /** + * Notes about the employee. + */ + public AccountingEmployee withNotes(JsonNullable notes) { + Utils.checkNotNull(notes, "notes"); + this.notes = notes; + return this; + } + + /** + * Addresses of the employee. + */ + public AccountingEmployee withAddresses(List

addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = Optional.ofNullable(addresses); + return this; + } + + + /** + * Addresses of the employee. + */ + public AccountingEmployee withAddresses(Optional> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + return this; + } + + /** + * Phone numbers of the employee. + */ + public AccountingEmployee withPhoneNumbers(List phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + + /** + * Phone numbers of the employee. + */ + public AccountingEmployee withPhoneNumbers(Optional> phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = phoneNumbers; + return this; + } + + public AccountingEmployee withCustomFields(List customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = Optional.ofNullable(customFields); + return this; + } + + + public AccountingEmployee withCustomFields(Optional> customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = customFields; + return this; + } + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + public AccountingEmployee withCustomMappings(Map customMappings) { + Utils.checkNotNull(customMappings, "customMappings"); + this.customMappings = JsonNullable.of(customMappings); + return this; + } + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + public AccountingEmployee withCustomMappings(JsonNullable> customMappings) { + Utils.checkNotNull(customMappings, "customMappings"); + this.customMappings = customMappings; + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public AccountingEmployee withRowVersion(String rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = JsonNullable.of(rowVersion); + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public AccountingEmployee withRowVersion(JsonNullable rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = rowVersion; + return this; + } + + /** + * The date and time when the object was last updated. + */ + public AccountingEmployee withUpdatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = JsonNullable.of(updatedAt); + return this; + } + + /** + * The date and time when the object was last updated. + */ + public AccountingEmployee withUpdatedAt(JsonNullable updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * The date and time when the object was created. + */ + public AccountingEmployee withCreatedAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = JsonNullable.of(createdAt); + return this; + } + + /** + * The date and time when the object was created. + */ + public AccountingEmployee withCreatedAt(JsonNullable createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public AccountingEmployee withPassThrough(List passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = Optional.ofNullable(passThrough); + return this; + } + + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public AccountingEmployee withPassThrough(Optional> passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = passThrough; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployee other = (AccountingEmployee) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.downstreamId, other.downstreamId) && + Utils.enhancedDeepEquals(this.displayId, other.displayId) && + Utils.enhancedDeepEquals(this.firstName, other.firstName) && + Utils.enhancedDeepEquals(this.lastName, other.lastName) && + Utils.enhancedDeepEquals(this.displayName, other.displayName) && + Utils.enhancedDeepEquals(this.emails, other.emails) && + Utils.enhancedDeepEquals(this.employeeNumber, other.employeeNumber) && + Utils.enhancedDeepEquals(this.jobTitle, other.jobTitle) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.isContractor, other.isContractor) && + Utils.enhancedDeepEquals(this.department, other.department) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.manager, other.manager) && + Utils.enhancedDeepEquals(this.hireDate, other.hireDate) && + Utils.enhancedDeepEquals(this.terminationDate, other.terminationDate) && + Utils.enhancedDeepEquals(this.gender, other.gender) && + Utils.enhancedDeepEquals(this.birthDate, other.birthDate) && + Utils.enhancedDeepEquals(this.subsidiary, other.subsidiary) && + Utils.enhancedDeepEquals(this.trackingCategories, other.trackingCategories) && + Utils.enhancedDeepEquals(this.currency, other.currency) && + Utils.enhancedDeepEquals(this.notes, other.notes) && + Utils.enhancedDeepEquals(this.addresses, other.addresses) && + Utils.enhancedDeepEquals(this.phoneNumbers, other.phoneNumbers) && + Utils.enhancedDeepEquals(this.customFields, other.customFields) && + Utils.enhancedDeepEquals(this.customMappings, other.customMappings) && + Utils.enhancedDeepEquals(this.rowVersion, other.rowVersion) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.passThrough, other.passThrough); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, downstreamId, displayId, + firstName, lastName, displayName, + emails, employeeNumber, jobTitle, + status, isContractor, department, + location, manager, hireDate, + terminationDate, gender, birthDate, + subsidiary, trackingCategories, currency, + notes, addresses, phoneNumbers, + customFields, customMappings, rowVersion, + updatedAt, createdAt, passThrough); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployee.class, + "id", id, + "downstreamId", downstreamId, + "displayId", displayId, + "firstName", firstName, + "lastName", lastName, + "displayName", displayName, + "emails", emails, + "employeeNumber", employeeNumber, + "jobTitle", jobTitle, + "status", status, + "isContractor", isContractor, + "department", department, + "location", location, + "manager", manager, + "hireDate", hireDate, + "terminationDate", terminationDate, + "gender", gender, + "birthDate", birthDate, + "subsidiary", subsidiary, + "trackingCategories", trackingCategories, + "currency", currency, + "notes", notes, + "addresses", addresses, + "phoneNumbers", phoneNumbers, + "customFields", customFields, + "customMappings", customMappings, + "rowVersion", rowVersion, + "updatedAt", updatedAt, + "createdAt", createdAt, + "passThrough", passThrough); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional id = Optional.empty(); + + private JsonNullable downstreamId = JsonNullable.undefined(); + + private JsonNullable displayId = JsonNullable.undefined(); + + private JsonNullable firstName = JsonNullable.undefined(); + + private JsonNullable lastName = JsonNullable.undefined(); + + private JsonNullable displayName = JsonNullable.undefined(); + + private Optional> emails = Optional.empty(); + + private JsonNullable employeeNumber = JsonNullable.undefined(); + + private JsonNullable jobTitle = JsonNullable.undefined(); + + private JsonNullable status = JsonNullable.undefined(); + + private JsonNullable isContractor = JsonNullable.undefined(); + + private JsonNullable department = JsonNullable.undefined(); + + private JsonNullable location = JsonNullable.undefined(); + + private Optional manager = Optional.empty(); + + private JsonNullable hireDate = JsonNullable.undefined(); + + private JsonNullable terminationDate = JsonNullable.undefined(); + + private JsonNullable gender = JsonNullable.undefined(); + + private JsonNullable birthDate = JsonNullable.undefined(); + + private JsonNullable subsidiary = JsonNullable.undefined(); + + private JsonNullable> trackingCategories = JsonNullable.undefined(); + + private JsonNullable currency = JsonNullable.undefined(); + + private JsonNullable notes = JsonNullable.undefined(); + + private Optional> addresses = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional> customFields = Optional.empty(); + + private JsonNullable> customMappings = JsonNullable.undefined(); + + private JsonNullable rowVersion = JsonNullable.undefined(); + + private JsonNullable updatedAt = JsonNullable.undefined(); + + private JsonNullable createdAt = JsonNullable.undefined(); + + private Optional> passThrough = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * A unique identifier for an object. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * A unique identifier for an object. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * The third-party API ID of original entity + */ + public Builder downstreamId(String downstreamId) { + Utils.checkNotNull(downstreamId, "downstreamId"); + this.downstreamId = JsonNullable.of(downstreamId); + return this; + } + + /** + * The third-party API ID of original entity + */ + public Builder downstreamId(JsonNullable downstreamId) { + Utils.checkNotNull(downstreamId, "downstreamId"); + this.downstreamId = downstreamId; + return this; + } + + + /** + * Id to be displayed. + */ + public Builder displayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public Builder displayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + + /** + * The first name of the employee. + */ + public Builder firstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + /** + * The first name of the employee. + */ + public Builder firstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + + /** + * The last name of the employee. + */ + public Builder lastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + /** + * The last name of the employee. + */ + public Builder lastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + + /** + * The display name of the employee. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = JsonNullable.of(displayName); + return this; + } + + /** + * The display name of the employee. + */ + public Builder displayName(JsonNullable displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + + /** + * Email addresses of the employee. + */ + public Builder emails(List emails) { + Utils.checkNotNull(emails, "emails"); + this.emails = Optional.ofNullable(emails); + return this; + } + + /** + * Email addresses of the employee. + */ + public Builder emails(Optional> emails) { + Utils.checkNotNull(emails, "emails"); + this.emails = emails; + return this; + } + + + /** + * The employee number or identifier. + */ + public Builder employeeNumber(String employeeNumber) { + Utils.checkNotNull(employeeNumber, "employeeNumber"); + this.employeeNumber = JsonNullable.of(employeeNumber); + return this; + } + + /** + * The employee number or identifier. + */ + public Builder employeeNumber(JsonNullable employeeNumber) { + Utils.checkNotNull(employeeNumber, "employeeNumber"); + this.employeeNumber = employeeNumber; + return this; + } + + + /** + * The job title of the employee. + */ + public Builder jobTitle(String jobTitle) { + Utils.checkNotNull(jobTitle, "jobTitle"); + this.jobTitle = JsonNullable.of(jobTitle); + return this; + } + + /** + * The job title of the employee. + */ + public Builder jobTitle(JsonNullable jobTitle) { + Utils.checkNotNull(jobTitle, "jobTitle"); + this.jobTitle = jobTitle; + return this; + } + + + /** + * The status of the employee. + */ + public Builder status(EmployeeStatus status) { + Utils.checkNotNull(status, "status"); + this.status = JsonNullable.of(status); + return this; + } + + /** + * The status of the employee. + */ + public Builder status(JsonNullable status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Whether the employee is a contractor. + */ + public Builder isContractor(boolean isContractor) { + Utils.checkNotNull(isContractor, "isContractor"); + this.isContractor = JsonNullable.of(isContractor); + return this; + } + + /** + * Whether the employee is a contractor. + */ + public Builder isContractor(JsonNullable isContractor) { + Utils.checkNotNull(isContractor, "isContractor"); + this.isContractor = isContractor; + return this; + } + + + public Builder department(LinkedDepartment department) { + Utils.checkNotNull(department, "department"); + this.department = JsonNullable.of(department); + return this; + } + + public Builder department(JsonNullable department) { + Utils.checkNotNull(department, "department"); + this.department = department; + return this; + } + + + public Builder location(LinkedLocation location) { + Utils.checkNotNull(location, "location"); + this.location = JsonNullable.of(location); + return this; + } + + public Builder location(JsonNullable location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + + /** + * The manager of the employee. + */ + public Builder manager(AccountingEmployeeManager manager) { + Utils.checkNotNull(manager, "manager"); + this.manager = Optional.ofNullable(manager); + return this; + } + + /** + * The manager of the employee. + */ + public Builder manager(Optional manager) { + Utils.checkNotNull(manager, "manager"); + this.manager = manager; + return this; + } + + + /** + * The date the employee was hired. + */ + public Builder hireDate(LocalDate hireDate) { + Utils.checkNotNull(hireDate, "hireDate"); + this.hireDate = JsonNullable.of(hireDate); + return this; + } + + /** + * The date the employee was hired. + */ + public Builder hireDate(JsonNullable hireDate) { + Utils.checkNotNull(hireDate, "hireDate"); + this.hireDate = hireDate; + return this; + } + + + /** + * The date the employee was terminated. + */ + public Builder terminationDate(LocalDate terminationDate) { + Utils.checkNotNull(terminationDate, "terminationDate"); + this.terminationDate = JsonNullable.of(terminationDate); + return this; + } + + /** + * The date the employee was terminated. + */ + public Builder terminationDate(JsonNullable terminationDate) { + Utils.checkNotNull(terminationDate, "terminationDate"); + this.terminationDate = terminationDate; + return this; + } + + + /** + * The gender represents the gender identity of a person. + */ + public Builder gender(Gender gender) { + Utils.checkNotNull(gender, "gender"); + this.gender = JsonNullable.of(gender); + return this; + } + + /** + * The gender represents the gender identity of a person. + */ + public Builder gender(JsonNullable gender) { + Utils.checkNotNull(gender, "gender"); + this.gender = gender; + return this; + } + + + /** + * The date of birth of the employee. + */ + public Builder birthDate(LocalDate birthDate) { + Utils.checkNotNull(birthDate, "birthDate"); + this.birthDate = JsonNullable.of(birthDate); + return this; + } + + /** + * The date of birth of the employee. + */ + public Builder birthDate(JsonNullable birthDate) { + Utils.checkNotNull(birthDate, "birthDate"); + this.birthDate = birthDate; + return this; + } + + + public Builder subsidiary(LinkedSubsidiary subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = JsonNullable.of(subsidiary); + return this; + } + + public Builder subsidiary(JsonNullable subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = subsidiary; + return this; + } + + + /** + * A list of linked tracking categories. + */ + public Builder trackingCategories(List trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = JsonNullable.of(trackingCategories); + return this; + } + + /** + * A list of linked tracking categories. + */ + public Builder trackingCategories(JsonNullable> trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = trackingCategories; + return this; + } + + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public Builder currency(Currency currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public Builder currency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + + /** + * Notes about the employee. + */ + public Builder notes(String notes) { + Utils.checkNotNull(notes, "notes"); + this.notes = JsonNullable.of(notes); + return this; + } + + /** + * Notes about the employee. + */ + public Builder notes(JsonNullable notes) { + Utils.checkNotNull(notes, "notes"); + this.notes = notes; + return this; + } + + + /** + * Addresses of the employee. + */ + public Builder addresses(List
addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = Optional.ofNullable(addresses); + return this; + } + + /** + * Addresses of the employee. + */ + public Builder addresses(Optional> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + return this; + } + + + /** + * Phone numbers of the employee. + */ + public Builder phoneNumbers(List phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + /** + * Phone numbers of the employee. + */ + public Builder phoneNumbers(Optional> phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = phoneNumbers; + return this; + } + + + public Builder customFields(List customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = Optional.ofNullable(customFields); + return this; + } + + public Builder customFields(Optional> customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = customFields; + return this; + } + + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + public Builder customMappings(Map customMappings) { + Utils.checkNotNull(customMappings, "customMappings"); + this.customMappings = JsonNullable.of(customMappings); + return this; + } + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + public Builder customMappings(JsonNullable> customMappings) { + Utils.checkNotNull(customMappings, "customMappings"); + this.customMappings = customMappings; + return this; + } + + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public Builder rowVersion(String rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = JsonNullable.of(rowVersion); + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public Builder rowVersion(JsonNullable rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = rowVersion; + return this; + } + + + /** + * The date and time when the object was last updated. + */ + public Builder updatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = JsonNullable.of(updatedAt); + return this; + } + + /** + * The date and time when the object was last updated. + */ + public Builder updatedAt(JsonNullable updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + + /** + * The date and time when the object was created. + */ + public Builder createdAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = JsonNullable.of(createdAt); + return this; + } + + /** + * The date and time when the object was created. + */ + public Builder createdAt(JsonNullable createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public Builder passThrough(List passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = Optional.ofNullable(passThrough); + return this; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public Builder passThrough(Optional> passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = passThrough; + return this; + } + + public AccountingEmployee build() { + + return new AccountingEmployee( + id, downstreamId, displayId, + firstName, lastName, displayName, + emails, employeeNumber, jobTitle, + status, isContractor, department, + location, manager, hireDate, + terminationDate, gender, birthDate, + subsidiary, trackingCategories, currency, + notes, addresses, phoneNumbers, + customFields, customMappings, rowVersion, + updatedAt, createdAt, passThrough); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/AccountingEmployeeInput.java b/src/main/java/com/apideck/unify/models/components/AccountingEmployeeInput.java new file mode 100644 index 000000000..31f131417 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/AccountingEmployeeInput.java @@ -0,0 +1,1541 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.LocalDate; +import java.util.List; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingEmployeeInput { + /** + * Id to be displayed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("display_id") + private JsonNullable displayId; + + /** + * The first name of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("first_name") + private JsonNullable firstName; + + /** + * The last name of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("last_name") + private JsonNullable lastName; + + /** + * The display name of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("display_name") + private JsonNullable displayName; + + /** + * Email addresses of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("emails") + private Optional> emails; + + /** + * The employee number or identifier. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("employee_number") + private JsonNullable employeeNumber; + + /** + * The job title of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("job_title") + private JsonNullable jobTitle; + + /** + * The status of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private JsonNullable status; + + /** + * Whether the employee is a contractor. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("is_contractor") + private JsonNullable isContractor; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("department") + private JsonNullable department; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("location") + private JsonNullable location; + + /** + * The manager of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("manager") + private Optional manager; + + /** + * The date the employee was hired. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("hire_date") + private JsonNullable hireDate; + + /** + * The date the employee was terminated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("termination_date") + private JsonNullable terminationDate; + + /** + * The gender represents the gender identity of a person. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("gender") + private JsonNullable gender; + + /** + * The date of birth of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("birth_date") + private JsonNullable birthDate; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subsidiary") + private JsonNullable subsidiary; + + /** + * A list of linked tracking categories. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tracking_categories") + private JsonNullable> trackingCategories; + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private JsonNullable currency; + + /** + * Notes about the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("notes") + private JsonNullable notes; + + /** + * Addresses of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("addresses") + private Optional> addresses; + + /** + * Phone numbers of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("phone_numbers") + private Optional> phoneNumbers; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("custom_fields") + private Optional> customFields; + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("row_version") + private JsonNullable rowVersion; + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("pass_through") + private Optional> passThrough; + + @JsonCreator + public AccountingEmployeeInput( + @JsonProperty("display_id") JsonNullable displayId, + @JsonProperty("first_name") JsonNullable firstName, + @JsonProperty("last_name") JsonNullable lastName, + @JsonProperty("display_name") JsonNullable displayName, + @JsonProperty("emails") Optional> emails, + @JsonProperty("employee_number") JsonNullable employeeNumber, + @JsonProperty("job_title") JsonNullable jobTitle, + @JsonProperty("status") JsonNullable status, + @JsonProperty("is_contractor") JsonNullable isContractor, + @JsonProperty("department") JsonNullable department, + @JsonProperty("location") JsonNullable location, + @JsonProperty("manager") Optional manager, + @JsonProperty("hire_date") JsonNullable hireDate, + @JsonProperty("termination_date") JsonNullable terminationDate, + @JsonProperty("gender") JsonNullable gender, + @JsonProperty("birth_date") JsonNullable birthDate, + @JsonProperty("subsidiary") JsonNullable subsidiary, + @JsonProperty("tracking_categories") JsonNullable> trackingCategories, + @JsonProperty("currency") JsonNullable currency, + @JsonProperty("notes") JsonNullable notes, + @JsonProperty("addresses") Optional> addresses, + @JsonProperty("phone_numbers") Optional> phoneNumbers, + @JsonProperty("custom_fields") Optional> customFields, + @JsonProperty("row_version") JsonNullable rowVersion, + @JsonProperty("pass_through") Optional> passThrough) { + Utils.checkNotNull(displayId, "displayId"); + Utils.checkNotNull(firstName, "firstName"); + Utils.checkNotNull(lastName, "lastName"); + Utils.checkNotNull(displayName, "displayName"); + Utils.checkNotNull(emails, "emails"); + Utils.checkNotNull(employeeNumber, "employeeNumber"); + Utils.checkNotNull(jobTitle, "jobTitle"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(isContractor, "isContractor"); + Utils.checkNotNull(department, "department"); + Utils.checkNotNull(location, "location"); + Utils.checkNotNull(manager, "manager"); + Utils.checkNotNull(hireDate, "hireDate"); + Utils.checkNotNull(terminationDate, "terminationDate"); + Utils.checkNotNull(gender, "gender"); + Utils.checkNotNull(birthDate, "birthDate"); + Utils.checkNotNull(subsidiary, "subsidiary"); + Utils.checkNotNull(trackingCategories, "trackingCategories"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(notes, "notes"); + Utils.checkNotNull(addresses, "addresses"); + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + Utils.checkNotNull(customFields, "customFields"); + Utils.checkNotNull(rowVersion, "rowVersion"); + Utils.checkNotNull(passThrough, "passThrough"); + this.displayId = displayId; + this.firstName = firstName; + this.lastName = lastName; + this.displayName = displayName; + this.emails = emails; + this.employeeNumber = employeeNumber; + this.jobTitle = jobTitle; + this.status = status; + this.isContractor = isContractor; + this.department = department; + this.location = location; + this.manager = manager; + this.hireDate = hireDate; + this.terminationDate = terminationDate; + this.gender = gender; + this.birthDate = birthDate; + this.subsidiary = subsidiary; + this.trackingCategories = trackingCategories; + this.currency = currency; + this.notes = notes; + this.addresses = addresses; + this.phoneNumbers = phoneNumbers; + this.customFields = customFields; + this.rowVersion = rowVersion; + this.passThrough = passThrough; + } + + public AccountingEmployeeInput() { + this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), + Optional.empty(), Optional.empty(), JsonNullable.undefined(), + Optional.empty()); + } + + /** + * Id to be displayed. + */ + @JsonIgnore + public JsonNullable displayId() { + return displayId; + } + + /** + * The first name of the employee. + */ + @JsonIgnore + public JsonNullable firstName() { + return firstName; + } + + /** + * The last name of the employee. + */ + @JsonIgnore + public JsonNullable lastName() { + return lastName; + } + + /** + * The display name of the employee. + */ + @JsonIgnore + public JsonNullable displayName() { + return displayName; + } + + /** + * Email addresses of the employee. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> emails() { + return (Optional>) emails; + } + + /** + * The employee number or identifier. + */ + @JsonIgnore + public JsonNullable employeeNumber() { + return employeeNumber; + } + + /** + * The job title of the employee. + */ + @JsonIgnore + public JsonNullable jobTitle() { + return jobTitle; + } + + /** + * The status of the employee. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable status() { + return (JsonNullable) status; + } + + /** + * Whether the employee is a contractor. + */ + @JsonIgnore + public JsonNullable isContractor() { + return isContractor; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable department() { + return (JsonNullable) department; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable location() { + return (JsonNullable) location; + } + + /** + * The manager of the employee. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional manager() { + return (Optional) manager; + } + + /** + * The date the employee was hired. + */ + @JsonIgnore + public JsonNullable hireDate() { + return hireDate; + } + + /** + * The date the employee was terminated. + */ + @JsonIgnore + public JsonNullable terminationDate() { + return terminationDate; + } + + /** + * The gender represents the gender identity of a person. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable gender() { + return (JsonNullable) gender; + } + + /** + * The date of birth of the employee. + */ + @JsonIgnore + public JsonNullable birthDate() { + return birthDate; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable subsidiary() { + return (JsonNullable) subsidiary; + } + + /** + * A list of linked tracking categories. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> trackingCategories() { + return (JsonNullable>) trackingCategories; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable currency() { + return (JsonNullable) currency; + } + + /** + * Notes about the employee. + */ + @JsonIgnore + public JsonNullable notes() { + return notes; + } + + /** + * Addresses of the employee. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> addresses() { + return (Optional>) addresses; + } + + /** + * Phone numbers of the employee. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> phoneNumbers() { + return (Optional>) phoneNumbers; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> customFields() { + return (Optional>) customFields; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + @JsonIgnore + public JsonNullable rowVersion() { + return rowVersion; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> passThrough() { + return (Optional>) passThrough; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Id to be displayed. + */ + public AccountingEmployeeInput withDisplayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public AccountingEmployeeInput withDisplayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + /** + * The first name of the employee. + */ + public AccountingEmployeeInput withFirstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + /** + * The first name of the employee. + */ + public AccountingEmployeeInput withFirstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + /** + * The last name of the employee. + */ + public AccountingEmployeeInput withLastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + /** + * The last name of the employee. + */ + public AccountingEmployeeInput withLastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + /** + * The display name of the employee. + */ + public AccountingEmployeeInput withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = JsonNullable.of(displayName); + return this; + } + + /** + * The display name of the employee. + */ + public AccountingEmployeeInput withDisplayName(JsonNullable displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + /** + * Email addresses of the employee. + */ + public AccountingEmployeeInput withEmails(List emails) { + Utils.checkNotNull(emails, "emails"); + this.emails = Optional.ofNullable(emails); + return this; + } + + + /** + * Email addresses of the employee. + */ + public AccountingEmployeeInput withEmails(Optional> emails) { + Utils.checkNotNull(emails, "emails"); + this.emails = emails; + return this; + } + + /** + * The employee number or identifier. + */ + public AccountingEmployeeInput withEmployeeNumber(String employeeNumber) { + Utils.checkNotNull(employeeNumber, "employeeNumber"); + this.employeeNumber = JsonNullable.of(employeeNumber); + return this; + } + + /** + * The employee number or identifier. + */ + public AccountingEmployeeInput withEmployeeNumber(JsonNullable employeeNumber) { + Utils.checkNotNull(employeeNumber, "employeeNumber"); + this.employeeNumber = employeeNumber; + return this; + } + + /** + * The job title of the employee. + */ + public AccountingEmployeeInput withJobTitle(String jobTitle) { + Utils.checkNotNull(jobTitle, "jobTitle"); + this.jobTitle = JsonNullable.of(jobTitle); + return this; + } + + /** + * The job title of the employee. + */ + public AccountingEmployeeInput withJobTitle(JsonNullable jobTitle) { + Utils.checkNotNull(jobTitle, "jobTitle"); + this.jobTitle = jobTitle; + return this; + } + + /** + * The status of the employee. + */ + public AccountingEmployeeInput withStatus(EmployeeStatus status) { + Utils.checkNotNull(status, "status"); + this.status = JsonNullable.of(status); + return this; + } + + /** + * The status of the employee. + */ + public AccountingEmployeeInput withStatus(JsonNullable status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Whether the employee is a contractor. + */ + public AccountingEmployeeInput withIsContractor(boolean isContractor) { + Utils.checkNotNull(isContractor, "isContractor"); + this.isContractor = JsonNullable.of(isContractor); + return this; + } + + /** + * Whether the employee is a contractor. + */ + public AccountingEmployeeInput withIsContractor(JsonNullable isContractor) { + Utils.checkNotNull(isContractor, "isContractor"); + this.isContractor = isContractor; + return this; + } + + public AccountingEmployeeInput withDepartment(LinkedDepartmentInput department) { + Utils.checkNotNull(department, "department"); + this.department = JsonNullable.of(department); + return this; + } + + public AccountingEmployeeInput withDepartment(JsonNullable department) { + Utils.checkNotNull(department, "department"); + this.department = department; + return this; + } + + public AccountingEmployeeInput withLocation(LinkedLocationInput location) { + Utils.checkNotNull(location, "location"); + this.location = JsonNullable.of(location); + return this; + } + + public AccountingEmployeeInput withLocation(JsonNullable location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + /** + * The manager of the employee. + */ + public AccountingEmployeeInput withManager(AccountingEmployeeManager manager) { + Utils.checkNotNull(manager, "manager"); + this.manager = Optional.ofNullable(manager); + return this; + } + + + /** + * The manager of the employee. + */ + public AccountingEmployeeInput withManager(Optional manager) { + Utils.checkNotNull(manager, "manager"); + this.manager = manager; + return this; + } + + /** + * The date the employee was hired. + */ + public AccountingEmployeeInput withHireDate(LocalDate hireDate) { + Utils.checkNotNull(hireDate, "hireDate"); + this.hireDate = JsonNullable.of(hireDate); + return this; + } + + /** + * The date the employee was hired. + */ + public AccountingEmployeeInput withHireDate(JsonNullable hireDate) { + Utils.checkNotNull(hireDate, "hireDate"); + this.hireDate = hireDate; + return this; + } + + /** + * The date the employee was terminated. + */ + public AccountingEmployeeInput withTerminationDate(LocalDate terminationDate) { + Utils.checkNotNull(terminationDate, "terminationDate"); + this.terminationDate = JsonNullable.of(terminationDate); + return this; + } + + /** + * The date the employee was terminated. + */ + public AccountingEmployeeInput withTerminationDate(JsonNullable terminationDate) { + Utils.checkNotNull(terminationDate, "terminationDate"); + this.terminationDate = terminationDate; + return this; + } + + /** + * The gender represents the gender identity of a person. + */ + public AccountingEmployeeInput withGender(Gender gender) { + Utils.checkNotNull(gender, "gender"); + this.gender = JsonNullable.of(gender); + return this; + } + + /** + * The gender represents the gender identity of a person. + */ + public AccountingEmployeeInput withGender(JsonNullable gender) { + Utils.checkNotNull(gender, "gender"); + this.gender = gender; + return this; + } + + /** + * The date of birth of the employee. + */ + public AccountingEmployeeInput withBirthDate(LocalDate birthDate) { + Utils.checkNotNull(birthDate, "birthDate"); + this.birthDate = JsonNullable.of(birthDate); + return this; + } + + /** + * The date of birth of the employee. + */ + public AccountingEmployeeInput withBirthDate(JsonNullable birthDate) { + Utils.checkNotNull(birthDate, "birthDate"); + this.birthDate = birthDate; + return this; + } + + public AccountingEmployeeInput withSubsidiary(LinkedSubsidiaryInput subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = JsonNullable.of(subsidiary); + return this; + } + + public AccountingEmployeeInput withSubsidiary(JsonNullable subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = subsidiary; + return this; + } + + /** + * A list of linked tracking categories. + */ + public AccountingEmployeeInput withTrackingCategories(List trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = JsonNullable.of(trackingCategories); + return this; + } + + /** + * A list of linked tracking categories. + */ + public AccountingEmployeeInput withTrackingCategories(JsonNullable> trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = trackingCategories; + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public AccountingEmployeeInput withCurrency(Currency currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public AccountingEmployeeInput withCurrency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Notes about the employee. + */ + public AccountingEmployeeInput withNotes(String notes) { + Utils.checkNotNull(notes, "notes"); + this.notes = JsonNullable.of(notes); + return this; + } + + /** + * Notes about the employee. + */ + public AccountingEmployeeInput withNotes(JsonNullable notes) { + Utils.checkNotNull(notes, "notes"); + this.notes = notes; + return this; + } + + /** + * Addresses of the employee. + */ + public AccountingEmployeeInput withAddresses(List
addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = Optional.ofNullable(addresses); + return this; + } + + + /** + * Addresses of the employee. + */ + public AccountingEmployeeInput withAddresses(Optional> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + return this; + } + + /** + * Phone numbers of the employee. + */ + public AccountingEmployeeInput withPhoneNumbers(List phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + + /** + * Phone numbers of the employee. + */ + public AccountingEmployeeInput withPhoneNumbers(Optional> phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = phoneNumbers; + return this; + } + + public AccountingEmployeeInput withCustomFields(List customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = Optional.ofNullable(customFields); + return this; + } + + + public AccountingEmployeeInput withCustomFields(Optional> customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = customFields; + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public AccountingEmployeeInput withRowVersion(String rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = JsonNullable.of(rowVersion); + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public AccountingEmployeeInput withRowVersion(JsonNullable rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = rowVersion; + return this; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public AccountingEmployeeInput withPassThrough(List passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = Optional.ofNullable(passThrough); + return this; + } + + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public AccountingEmployeeInput withPassThrough(Optional> passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = passThrough; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeeInput other = (AccountingEmployeeInput) o; + return + Utils.enhancedDeepEquals(this.displayId, other.displayId) && + Utils.enhancedDeepEquals(this.firstName, other.firstName) && + Utils.enhancedDeepEquals(this.lastName, other.lastName) && + Utils.enhancedDeepEquals(this.displayName, other.displayName) && + Utils.enhancedDeepEquals(this.emails, other.emails) && + Utils.enhancedDeepEquals(this.employeeNumber, other.employeeNumber) && + Utils.enhancedDeepEquals(this.jobTitle, other.jobTitle) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.isContractor, other.isContractor) && + Utils.enhancedDeepEquals(this.department, other.department) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.manager, other.manager) && + Utils.enhancedDeepEquals(this.hireDate, other.hireDate) && + Utils.enhancedDeepEquals(this.terminationDate, other.terminationDate) && + Utils.enhancedDeepEquals(this.gender, other.gender) && + Utils.enhancedDeepEquals(this.birthDate, other.birthDate) && + Utils.enhancedDeepEquals(this.subsidiary, other.subsidiary) && + Utils.enhancedDeepEquals(this.trackingCategories, other.trackingCategories) && + Utils.enhancedDeepEquals(this.currency, other.currency) && + Utils.enhancedDeepEquals(this.notes, other.notes) && + Utils.enhancedDeepEquals(this.addresses, other.addresses) && + Utils.enhancedDeepEquals(this.phoneNumbers, other.phoneNumbers) && + Utils.enhancedDeepEquals(this.customFields, other.customFields) && + Utils.enhancedDeepEquals(this.rowVersion, other.rowVersion) && + Utils.enhancedDeepEquals(this.passThrough, other.passThrough); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + displayId, firstName, lastName, + displayName, emails, employeeNumber, + jobTitle, status, isContractor, + department, location, manager, + hireDate, terminationDate, gender, + birthDate, subsidiary, trackingCategories, + currency, notes, addresses, + phoneNumbers, customFields, rowVersion, + passThrough); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeeInput.class, + "displayId", displayId, + "firstName", firstName, + "lastName", lastName, + "displayName", displayName, + "emails", emails, + "employeeNumber", employeeNumber, + "jobTitle", jobTitle, + "status", status, + "isContractor", isContractor, + "department", department, + "location", location, + "manager", manager, + "hireDate", hireDate, + "terminationDate", terminationDate, + "gender", gender, + "birthDate", birthDate, + "subsidiary", subsidiary, + "trackingCategories", trackingCategories, + "currency", currency, + "notes", notes, + "addresses", addresses, + "phoneNumbers", phoneNumbers, + "customFields", customFields, + "rowVersion", rowVersion, + "passThrough", passThrough); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private JsonNullable displayId = JsonNullable.undefined(); + + private JsonNullable firstName = JsonNullable.undefined(); + + private JsonNullable lastName = JsonNullable.undefined(); + + private JsonNullable displayName = JsonNullable.undefined(); + + private Optional> emails = Optional.empty(); + + private JsonNullable employeeNumber = JsonNullable.undefined(); + + private JsonNullable jobTitle = JsonNullable.undefined(); + + private JsonNullable status = JsonNullable.undefined(); + + private JsonNullable isContractor = JsonNullable.undefined(); + + private JsonNullable department = JsonNullable.undefined(); + + private JsonNullable location = JsonNullable.undefined(); + + private Optional manager = Optional.empty(); + + private JsonNullable hireDate = JsonNullable.undefined(); + + private JsonNullable terminationDate = JsonNullable.undefined(); + + private JsonNullable gender = JsonNullable.undefined(); + + private JsonNullable birthDate = JsonNullable.undefined(); + + private JsonNullable subsidiary = JsonNullable.undefined(); + + private JsonNullable> trackingCategories = JsonNullable.undefined(); + + private JsonNullable currency = JsonNullable.undefined(); + + private JsonNullable notes = JsonNullable.undefined(); + + private Optional> addresses = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional> customFields = Optional.empty(); + + private JsonNullable rowVersion = JsonNullable.undefined(); + + private Optional> passThrough = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * Id to be displayed. + */ + public Builder displayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public Builder displayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + + /** + * The first name of the employee. + */ + public Builder firstName(String firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = JsonNullable.of(firstName); + return this; + } + + /** + * The first name of the employee. + */ + public Builder firstName(JsonNullable firstName) { + Utils.checkNotNull(firstName, "firstName"); + this.firstName = firstName; + return this; + } + + + /** + * The last name of the employee. + */ + public Builder lastName(String lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = JsonNullable.of(lastName); + return this; + } + + /** + * The last name of the employee. + */ + public Builder lastName(JsonNullable lastName) { + Utils.checkNotNull(lastName, "lastName"); + this.lastName = lastName; + return this; + } + + + /** + * The display name of the employee. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = JsonNullable.of(displayName); + return this; + } + + /** + * The display name of the employee. + */ + public Builder displayName(JsonNullable displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + + /** + * Email addresses of the employee. + */ + public Builder emails(List emails) { + Utils.checkNotNull(emails, "emails"); + this.emails = Optional.ofNullable(emails); + return this; + } + + /** + * Email addresses of the employee. + */ + public Builder emails(Optional> emails) { + Utils.checkNotNull(emails, "emails"); + this.emails = emails; + return this; + } + + + /** + * The employee number or identifier. + */ + public Builder employeeNumber(String employeeNumber) { + Utils.checkNotNull(employeeNumber, "employeeNumber"); + this.employeeNumber = JsonNullable.of(employeeNumber); + return this; + } + + /** + * The employee number or identifier. + */ + public Builder employeeNumber(JsonNullable employeeNumber) { + Utils.checkNotNull(employeeNumber, "employeeNumber"); + this.employeeNumber = employeeNumber; + return this; + } + + + /** + * The job title of the employee. + */ + public Builder jobTitle(String jobTitle) { + Utils.checkNotNull(jobTitle, "jobTitle"); + this.jobTitle = JsonNullable.of(jobTitle); + return this; + } + + /** + * The job title of the employee. + */ + public Builder jobTitle(JsonNullable jobTitle) { + Utils.checkNotNull(jobTitle, "jobTitle"); + this.jobTitle = jobTitle; + return this; + } + + + /** + * The status of the employee. + */ + public Builder status(EmployeeStatus status) { + Utils.checkNotNull(status, "status"); + this.status = JsonNullable.of(status); + return this; + } + + /** + * The status of the employee. + */ + public Builder status(JsonNullable status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Whether the employee is a contractor. + */ + public Builder isContractor(boolean isContractor) { + Utils.checkNotNull(isContractor, "isContractor"); + this.isContractor = JsonNullable.of(isContractor); + return this; + } + + /** + * Whether the employee is a contractor. + */ + public Builder isContractor(JsonNullable isContractor) { + Utils.checkNotNull(isContractor, "isContractor"); + this.isContractor = isContractor; + return this; + } + + + public Builder department(LinkedDepartmentInput department) { + Utils.checkNotNull(department, "department"); + this.department = JsonNullable.of(department); + return this; + } + + public Builder department(JsonNullable department) { + Utils.checkNotNull(department, "department"); + this.department = department; + return this; + } + + + public Builder location(LinkedLocationInput location) { + Utils.checkNotNull(location, "location"); + this.location = JsonNullable.of(location); + return this; + } + + public Builder location(JsonNullable location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + + /** + * The manager of the employee. + */ + public Builder manager(AccountingEmployeeManager manager) { + Utils.checkNotNull(manager, "manager"); + this.manager = Optional.ofNullable(manager); + return this; + } + + /** + * The manager of the employee. + */ + public Builder manager(Optional manager) { + Utils.checkNotNull(manager, "manager"); + this.manager = manager; + return this; + } + + + /** + * The date the employee was hired. + */ + public Builder hireDate(LocalDate hireDate) { + Utils.checkNotNull(hireDate, "hireDate"); + this.hireDate = JsonNullable.of(hireDate); + return this; + } + + /** + * The date the employee was hired. + */ + public Builder hireDate(JsonNullable hireDate) { + Utils.checkNotNull(hireDate, "hireDate"); + this.hireDate = hireDate; + return this; + } + + + /** + * The date the employee was terminated. + */ + public Builder terminationDate(LocalDate terminationDate) { + Utils.checkNotNull(terminationDate, "terminationDate"); + this.terminationDate = JsonNullable.of(terminationDate); + return this; + } + + /** + * The date the employee was terminated. + */ + public Builder terminationDate(JsonNullable terminationDate) { + Utils.checkNotNull(terminationDate, "terminationDate"); + this.terminationDate = terminationDate; + return this; + } + + + /** + * The gender represents the gender identity of a person. + */ + public Builder gender(Gender gender) { + Utils.checkNotNull(gender, "gender"); + this.gender = JsonNullable.of(gender); + return this; + } + + /** + * The gender represents the gender identity of a person. + */ + public Builder gender(JsonNullable gender) { + Utils.checkNotNull(gender, "gender"); + this.gender = gender; + return this; + } + + + /** + * The date of birth of the employee. + */ + public Builder birthDate(LocalDate birthDate) { + Utils.checkNotNull(birthDate, "birthDate"); + this.birthDate = JsonNullable.of(birthDate); + return this; + } + + /** + * The date of birth of the employee. + */ + public Builder birthDate(JsonNullable birthDate) { + Utils.checkNotNull(birthDate, "birthDate"); + this.birthDate = birthDate; + return this; + } + + + public Builder subsidiary(LinkedSubsidiaryInput subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = JsonNullable.of(subsidiary); + return this; + } + + public Builder subsidiary(JsonNullable subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = subsidiary; + return this; + } + + + /** + * A list of linked tracking categories. + */ + public Builder trackingCategories(List trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = JsonNullable.of(trackingCategories); + return this; + } + + /** + * A list of linked tracking categories. + */ + public Builder trackingCategories(JsonNullable> trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = trackingCategories; + return this; + } + + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public Builder currency(Currency currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public Builder currency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + + /** + * Notes about the employee. + */ + public Builder notes(String notes) { + Utils.checkNotNull(notes, "notes"); + this.notes = JsonNullable.of(notes); + return this; + } + + /** + * Notes about the employee. + */ + public Builder notes(JsonNullable notes) { + Utils.checkNotNull(notes, "notes"); + this.notes = notes; + return this; + } + + + /** + * Addresses of the employee. + */ + public Builder addresses(List
addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = Optional.ofNullable(addresses); + return this; + } + + /** + * Addresses of the employee. + */ + public Builder addresses(Optional> addresses) { + Utils.checkNotNull(addresses, "addresses"); + this.addresses = addresses; + return this; + } + + + /** + * Phone numbers of the employee. + */ + public Builder phoneNumbers(List phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + /** + * Phone numbers of the employee. + */ + public Builder phoneNumbers(Optional> phoneNumbers) { + Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + this.phoneNumbers = phoneNumbers; + return this; + } + + + public Builder customFields(List customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = Optional.ofNullable(customFields); + return this; + } + + public Builder customFields(Optional> customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = customFields; + return this; + } + + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public Builder rowVersion(String rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = JsonNullable.of(rowVersion); + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public Builder rowVersion(JsonNullable rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = rowVersion; + return this; + } + + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public Builder passThrough(List passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = Optional.ofNullable(passThrough); + return this; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public Builder passThrough(Optional> passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = passThrough; + return this; + } + + public AccountingEmployeeInput build() { + + return new AccountingEmployeeInput( + displayId, firstName, lastName, + displayName, emails, employeeNumber, + jobTitle, status, isContractor, + department, location, manager, + hireDate, terminationDate, gender, + birthDate, subsidiary, trackingCategories, + currency, notes, addresses, + phoneNumbers, customFields, rowVersion, + passThrough); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/AccountingEmployeeManager.java b/src/main/java/com/apideck/unify/models/components/AccountingEmployeeManager.java new file mode 100644 index 000000000..c2a59c561 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/AccountingEmployeeManager.java @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Override; +import java.lang.String; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingEmployeeManager + * + *

The manager of the employee. + */ +public class AccountingEmployeeManager { + /** + * A unique identifier for the manager. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The name of the manager. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + @JsonCreator + public AccountingEmployeeManager( + @JsonProperty("id") Optional id, + @JsonProperty("name") JsonNullable name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + public AccountingEmployeeManager() { + this(Optional.empty(), JsonNullable.undefined()); + } + + /** + * A unique identifier for the manager. + */ + @JsonIgnore + public Optional id() { + return id; + } + + /** + * The name of the manager. + */ + @JsonIgnore + public JsonNullable name() { + return name; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * A unique identifier for the manager. + */ + public AccountingEmployeeManager withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + + /** + * A unique identifier for the manager. + */ + public AccountingEmployeeManager withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The name of the manager. + */ + public AccountingEmployeeManager withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The name of the manager. + */ + public AccountingEmployeeManager withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeeManager other = (AccountingEmployeeManager) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, name); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeeManager.class, + "id", id, + "name", name); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional id = Optional.empty(); + + private JsonNullable name = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * A unique identifier for the manager. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * A unique identifier for the manager. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * The name of the manager. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The name of the manager. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public AccountingEmployeeManager build() { + + return new AccountingEmployeeManager( + id, name); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/AccountingEmployeesFilter.java b/src/main/java/com/apideck/unify/models/components/AccountingEmployeesFilter.java new file mode 100644 index 000000000..f24a93b35 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/AccountingEmployeesFilter.java @@ -0,0 +1,153 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.OffsetDateTime; +import java.util.Optional; + + +public class AccountingEmployeesFilter { + + @SpeakeasyMetadata("queryParam:name=updated_since") + private Optional updatedSince; + + + @SpeakeasyMetadata("queryParam:name=status") + private Optional status; + + @JsonCreator + public AccountingEmployeesFilter( + Optional updatedSince, + Optional status) { + Utils.checkNotNull(updatedSince, "updatedSince"); + Utils.checkNotNull(status, "status"); + this.updatedSince = updatedSince; + this.status = status; + } + + public AccountingEmployeesFilter() { + this(Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public Optional updatedSince() { + return updatedSince; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; + } + + public static Builder builder() { + return new Builder(); + } + + + public AccountingEmployeesFilter withUpdatedSince(OffsetDateTime updatedSince) { + Utils.checkNotNull(updatedSince, "updatedSince"); + this.updatedSince = Optional.ofNullable(updatedSince); + return this; + } + + + public AccountingEmployeesFilter withUpdatedSince(Optional updatedSince) { + Utils.checkNotNull(updatedSince, "updatedSince"); + this.updatedSince = updatedSince; + return this; + } + + public AccountingEmployeesFilter withStatus(AccountingEmployeesFilterStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + + public AccountingEmployeesFilter withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesFilter other = (AccountingEmployeesFilter) o; + return + Utils.enhancedDeepEquals(this.updatedSince, other.updatedSince) && + Utils.enhancedDeepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + updatedSince, status); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesFilter.class, + "updatedSince", updatedSince, + "status", status); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional updatedSince = Optional.empty(); + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + public Builder updatedSince(OffsetDateTime updatedSince) { + Utils.checkNotNull(updatedSince, "updatedSince"); + this.updatedSince = Optional.ofNullable(updatedSince); + return this; + } + + public Builder updatedSince(Optional updatedSince) { + Utils.checkNotNull(updatedSince, "updatedSince"); + this.updatedSince = updatedSince; + return this; + } + + + public Builder status(AccountingEmployeesFilterStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public AccountingEmployeesFilter build() { + + return new AccountingEmployeesFilter( + updatedSince, status); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/AccountingEmployeesFilterStatus.java b/src/main/java/com/apideck/unify/models/components/AccountingEmployeesFilterStatus.java new file mode 100644 index 000000000..ea9c21a84 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/AccountingEmployeesFilterStatus.java @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.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 AccountingEmployeesFilterStatus { + + public static final AccountingEmployeesFilterStatus ACTIVE = new AccountingEmployeesFilterStatus("active"); + public static final AccountingEmployeesFilterStatus INACTIVE = new AccountingEmployeesFilterStatus("inactive"); + public static final AccountingEmployeesFilterStatus TERMINATED = new AccountingEmployeesFilterStatus("terminated"); + + // 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 AccountingEmployeesFilterStatus(String value) { + this.value = value; + } + + /** + * Returns a AccountingEmployeesFilterStatus 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 AccountingEmployeesFilterStatus + */ + @JsonCreator + public static AccountingEmployeesFilterStatus of(String value) { + synchronized (AccountingEmployeesFilterStatus.class) { + return values.computeIfAbsent(value, v -> new AccountingEmployeesFilterStatus(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; + AccountingEmployeesFilterStatus other = (AccountingEmployeesFilterStatus) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "AccountingEmployeesFilterStatus [value=" + value + "]"; + } + + // return an array just like an enum + public static AccountingEmployeesFilterStatus[] values() { + synchronized (AccountingEmployeesFilterStatus.class) { + return values.values().toArray(new AccountingEmployeesFilterStatus[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("active", ACTIVE); + map.put("inactive", INACTIVE); + map.put("terminated", TERMINATED); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("active", AccountingEmployeesFilterStatusEnum.ACTIVE); + map.put("inactive", AccountingEmployeesFilterStatusEnum.INACTIVE); + map.put("terminated", AccountingEmployeesFilterStatusEnum.TERMINATED); + return map; + } + + + public enum AccountingEmployeesFilterStatusEnum { + + ACTIVE("active"), + INACTIVE("inactive"), + TERMINATED("terminated"),; + + private final String value; + + private AccountingEmployeesFilterStatusEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} + diff --git a/src/main/java/com/apideck/unify/models/components/AccountingPeriod.java b/src/main/java/com/apideck/unify/models/components/AccountingPeriod.java new file mode 100644 index 000000000..e2fe40874 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/AccountingPeriod.java @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Override; +import java.lang.String; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * AccountingPeriod + * + *

The accounting period the expense report is posted to. + */ +public class AccountingPeriod { + /** + * A unique identifier for the accounting period. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The name of the accounting period. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + @JsonCreator + public AccountingPeriod( + @JsonProperty("id") Optional id, + @JsonProperty("name") JsonNullable name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + public AccountingPeriod() { + this(Optional.empty(), JsonNullable.undefined()); + } + + /** + * A unique identifier for the accounting period. + */ + @JsonIgnore + public Optional id() { + return id; + } + + /** + * The name of the accounting period. + */ + @JsonIgnore + public JsonNullable name() { + return name; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * A unique identifier for the accounting period. + */ + public AccountingPeriod withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + + /** + * A unique identifier for the accounting period. + */ + public AccountingPeriod withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The name of the accounting period. + */ + public AccountingPeriod withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The name of the accounting period. + */ + public AccountingPeriod withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingPeriod other = (AccountingPeriod) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, name); + } + + @Override + public String toString() { + return Utils.toString(AccountingPeriod.class, + "id", id, + "name", name); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional id = Optional.empty(); + + private JsonNullable name = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * A unique identifier for the accounting period. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * A unique identifier for the accounting period. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * The name of the accounting period. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The name of the accounting period. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public AccountingPeriod build() { + + return new AccountingPeriod( + id, name); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/ApprovedBy.java b/src/main/java/com/apideck/unify/models/components/ApprovedBy.java new file mode 100644 index 000000000..f190cafe8 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ApprovedBy.java @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Override; +import java.lang.String; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * ApprovedBy + * + *

The person who approved the expense report. + */ +public class ApprovedBy { + /** + * A unique identifier for the approver. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The display name of the approver. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("display_name") + private JsonNullable displayName; + + @JsonCreator + public ApprovedBy( + @JsonProperty("id") Optional id, + @JsonProperty("display_name") JsonNullable displayName) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(displayName, "displayName"); + this.id = id; + this.displayName = displayName; + } + + public ApprovedBy() { + this(Optional.empty(), JsonNullable.undefined()); + } + + /** + * A unique identifier for the approver. + */ + @JsonIgnore + public Optional id() { + return id; + } + + /** + * The display name of the approver. + */ + @JsonIgnore + public JsonNullable displayName() { + return displayName; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * A unique identifier for the approver. + */ + public ApprovedBy withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + + /** + * A unique identifier for the approver. + */ + public ApprovedBy withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The display name of the approver. + */ + public ApprovedBy withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = JsonNullable.of(displayName); + return this; + } + + /** + * The display name of the approver. + */ + public ApprovedBy withDisplayName(JsonNullable displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApprovedBy other = (ApprovedBy) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.displayName, other.displayName); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, displayName); + } + + @Override + public String toString() { + return Utils.toString(ApprovedBy.class, + "id", id, + "displayName", displayName); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional id = Optional.empty(); + + private JsonNullable displayName = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * A unique identifier for the approver. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * A unique identifier for the approver. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * The display name of the approver. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = JsonNullable.of(displayName); + return this; + } + + /** + * The display name of the approver. + */ + public Builder displayName(JsonNullable displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + public ApprovedBy build() { + + return new ApprovedBy( + id, displayName); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/CreateAccountingEmployeeResponse.java b/src/main/java/com/apideck/unify/models/components/CreateAccountingEmployeeResponse.java new file mode 100644 index 000000000..fe9ce41a7 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/CreateAccountingEmployeeResponse.java @@ -0,0 +1,388 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * CreateAccountingEmployeeResponse + * + *

Employees + */ +public class CreateAccountingEmployeeResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonProperty("data") + private UnifiedId data; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public CreateAccountingEmployeeResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") UnifiedId data, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.raw = raw; + } + + public CreateAccountingEmployeeResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + UnifiedId data) { + this(statusCode, status, service, + resource, operation, data, + JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonIgnore + public UnifiedId data() { + return data; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public CreateAccountingEmployeeResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public CreateAccountingEmployeeResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public CreateAccountingEmployeeResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public CreateAccountingEmployeeResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public CreateAccountingEmployeeResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public CreateAccountingEmployeeResponse withData(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public CreateAccountingEmployeeResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public CreateAccountingEmployeeResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateAccountingEmployeeResponse other = (CreateAccountingEmployeeResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + raw); + } + + @Override + public String toString() { + return Utils.toString(CreateAccountingEmployeeResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private UnifiedId data; + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public Builder data(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public CreateAccountingEmployeeResponse build() { + + return new CreateAccountingEmployeeResponse( + statusCode, status, service, + resource, operation, data, + raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/CreateExpenseCategoryResponse.java b/src/main/java/com/apideck/unify/models/components/CreateExpenseCategoryResponse.java new file mode 100644 index 000000000..595cc3e6f --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/CreateExpenseCategoryResponse.java @@ -0,0 +1,388 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * CreateExpenseCategoryResponse + * + *

Expense Categories + */ +public class CreateExpenseCategoryResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonProperty("data") + private UnifiedId data; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public CreateExpenseCategoryResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") UnifiedId data, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.raw = raw; + } + + public CreateExpenseCategoryResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + UnifiedId data) { + this(statusCode, status, service, + resource, operation, data, + JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonIgnore + public UnifiedId data() { + return data; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public CreateExpenseCategoryResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public CreateExpenseCategoryResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public CreateExpenseCategoryResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public CreateExpenseCategoryResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public CreateExpenseCategoryResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public CreateExpenseCategoryResponse withData(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public CreateExpenseCategoryResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public CreateExpenseCategoryResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateExpenseCategoryResponse other = (CreateExpenseCategoryResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + raw); + } + + @Override + public String toString() { + return Utils.toString(CreateExpenseCategoryResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private UnifiedId data; + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public Builder data(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public CreateExpenseCategoryResponse build() { + + return new CreateExpenseCategoryResponse( + statusCode, status, service, + resource, operation, data, + raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/CreateExpenseReportResponse.java b/src/main/java/com/apideck/unify/models/components/CreateExpenseReportResponse.java new file mode 100644 index 000000000..e0e380c60 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/CreateExpenseReportResponse.java @@ -0,0 +1,388 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * CreateExpenseReportResponse + * + *

Expense Reports + */ +public class CreateExpenseReportResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonProperty("data") + private UnifiedId data; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public CreateExpenseReportResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") UnifiedId data, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.raw = raw; + } + + public CreateExpenseReportResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + UnifiedId data) { + this(statusCode, status, service, + resource, operation, data, + JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonIgnore + public UnifiedId data() { + return data; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public CreateExpenseReportResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public CreateExpenseReportResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public CreateExpenseReportResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public CreateExpenseReportResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public CreateExpenseReportResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public CreateExpenseReportResponse withData(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public CreateExpenseReportResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public CreateExpenseReportResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateExpenseReportResponse other = (CreateExpenseReportResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + raw); + } + + @Override + public String toString() { + return Utils.toString(CreateExpenseReportResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private UnifiedId data; + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public Builder data(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public CreateExpenseReportResponse build() { + + return new CreateExpenseReportResponse( + statusCode, status, service, + resource, operation, data, + raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/DeleteAccountingEmployeeResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteAccountingEmployeeResponse.java new file mode 100644 index 000000000..c79629770 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/DeleteAccountingEmployeeResponse.java @@ -0,0 +1,388 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * DeleteAccountingEmployeeResponse + * + *

Employees + */ +public class DeleteAccountingEmployeeResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonProperty("data") + private UnifiedId data; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public DeleteAccountingEmployeeResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") UnifiedId data, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.raw = raw; + } + + public DeleteAccountingEmployeeResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + UnifiedId data) { + this(statusCode, status, service, + resource, operation, data, + JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonIgnore + public UnifiedId data() { + return data; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public DeleteAccountingEmployeeResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public DeleteAccountingEmployeeResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public DeleteAccountingEmployeeResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public DeleteAccountingEmployeeResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public DeleteAccountingEmployeeResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public DeleteAccountingEmployeeResponse withData(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public DeleteAccountingEmployeeResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public DeleteAccountingEmployeeResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteAccountingEmployeeResponse other = (DeleteAccountingEmployeeResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + raw); + } + + @Override + public String toString() { + return Utils.toString(DeleteAccountingEmployeeResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private UnifiedId data; + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public Builder data(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public DeleteAccountingEmployeeResponse build() { + + return new DeleteAccountingEmployeeResponse( + statusCode, status, service, + resource, operation, data, + raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/DeleteExpenseCategoryResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteExpenseCategoryResponse.java new file mode 100644 index 000000000..a3d211aa9 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/DeleteExpenseCategoryResponse.java @@ -0,0 +1,388 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * DeleteExpenseCategoryResponse + * + *

Expense Categories + */ +public class DeleteExpenseCategoryResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonProperty("data") + private UnifiedId data; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public DeleteExpenseCategoryResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") UnifiedId data, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.raw = raw; + } + + public DeleteExpenseCategoryResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + UnifiedId data) { + this(statusCode, status, service, + resource, operation, data, + JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonIgnore + public UnifiedId data() { + return data; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public DeleteExpenseCategoryResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public DeleteExpenseCategoryResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public DeleteExpenseCategoryResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public DeleteExpenseCategoryResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public DeleteExpenseCategoryResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public DeleteExpenseCategoryResponse withData(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public DeleteExpenseCategoryResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public DeleteExpenseCategoryResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteExpenseCategoryResponse other = (DeleteExpenseCategoryResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + raw); + } + + @Override + public String toString() { + return Utils.toString(DeleteExpenseCategoryResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private UnifiedId data; + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public Builder data(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public DeleteExpenseCategoryResponse build() { + + return new DeleteExpenseCategoryResponse( + statusCode, status, service, + resource, operation, data, + raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/DeleteExpenseReportResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteExpenseReportResponse.java new file mode 100644 index 000000000..cfbe127c4 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/DeleteExpenseReportResponse.java @@ -0,0 +1,388 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * DeleteExpenseReportResponse + * + *

Expense Reports + */ +public class DeleteExpenseReportResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonProperty("data") + private UnifiedId data; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public DeleteExpenseReportResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") UnifiedId data, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.raw = raw; + } + + public DeleteExpenseReportResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + UnifiedId data) { + this(statusCode, status, service, + resource, operation, data, + JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonIgnore + public UnifiedId data() { + return data; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public DeleteExpenseReportResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public DeleteExpenseReportResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public DeleteExpenseReportResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public DeleteExpenseReportResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public DeleteExpenseReportResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public DeleteExpenseReportResponse withData(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public DeleteExpenseReportResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public DeleteExpenseReportResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteExpenseReportResponse other = (DeleteExpenseReportResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + raw); + } + + @Override + public String toString() { + return Utils.toString(DeleteExpenseReportResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private UnifiedId data; + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public Builder data(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public DeleteExpenseReportResponse build() { + + return new DeleteExpenseReportResponse( + statusCode, status, service, + resource, operation, data, + raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/EmployeeStatus.java b/src/main/java/com/apideck/unify/models/components/EmployeeStatus.java new file mode 100644 index 000000000..fad01ba22 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/EmployeeStatus.java @@ -0,0 +1,136 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.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. + */ +/** + * EmployeeStatus + * + *

The status of the employee. + */ +public class EmployeeStatus { + + public static final EmployeeStatus ACTIVE = new EmployeeStatus("active"); + public static final EmployeeStatus INACTIVE = new EmployeeStatus("inactive"); + public static final EmployeeStatus TERMINATED = new EmployeeStatus("terminated"); + + // 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 EmployeeStatus(String value) { + this.value = value; + } + + /** + * Returns a EmployeeStatus 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 EmployeeStatus + */ + @JsonCreator + public static EmployeeStatus of(String value) { + synchronized (EmployeeStatus.class) { + return values.computeIfAbsent(value, v -> new EmployeeStatus(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; + EmployeeStatus other = (EmployeeStatus) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "EmployeeStatus [value=" + value + "]"; + } + + // return an array just like an enum + public static EmployeeStatus[] values() { + synchronized (EmployeeStatus.class) { + return values.values().toArray(new EmployeeStatus[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("active", ACTIVE); + map.put("inactive", INACTIVE); + map.put("terminated", TERMINATED); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("active", EmployeeStatusEnum.ACTIVE); + map.put("inactive", EmployeeStatusEnum.INACTIVE); + map.put("terminated", EmployeeStatusEnum.TERMINATED); + return map; + } + + + public enum EmployeeStatusEnum { + + ACTIVE("active"), + INACTIVE("inactive"), + TERMINATED("terminated"),; + + private final String value; + + private EmployeeStatusEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} + diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseCategoriesFilter.java b/src/main/java/com/apideck/unify/models/components/ExpenseCategoriesFilter.java new file mode 100644 index 000000000..e7cf66be8 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ExpenseCategoriesFilter.java @@ -0,0 +1,153 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.OffsetDateTime; +import java.util.Optional; + + +public class ExpenseCategoriesFilter { + + @SpeakeasyMetadata("queryParam:name=updated_since") + private Optional updatedSince; + + + @SpeakeasyMetadata("queryParam:name=status") + private Optional status; + + @JsonCreator + public ExpenseCategoriesFilter( + Optional updatedSince, + Optional status) { + Utils.checkNotNull(updatedSince, "updatedSince"); + Utils.checkNotNull(status, "status"); + this.updatedSince = updatedSince; + this.status = status; + } + + public ExpenseCategoriesFilter() { + this(Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public Optional updatedSince() { + return updatedSince; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; + } + + public static Builder builder() { + return new Builder(); + } + + + public ExpenseCategoriesFilter withUpdatedSince(OffsetDateTime updatedSince) { + Utils.checkNotNull(updatedSince, "updatedSince"); + this.updatedSince = Optional.ofNullable(updatedSince); + return this; + } + + + public ExpenseCategoriesFilter withUpdatedSince(Optional updatedSince) { + Utils.checkNotNull(updatedSince, "updatedSince"); + this.updatedSince = updatedSince; + return this; + } + + public ExpenseCategoriesFilter withStatus(ExpenseCategoriesFilterStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + + public ExpenseCategoriesFilter withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExpenseCategoriesFilter other = (ExpenseCategoriesFilter) o; + return + Utils.enhancedDeepEquals(this.updatedSince, other.updatedSince) && + Utils.enhancedDeepEquals(this.status, other.status); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + updatedSince, status); + } + + @Override + public String toString() { + return Utils.toString(ExpenseCategoriesFilter.class, + "updatedSince", updatedSince, + "status", status); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional updatedSince = Optional.empty(); + + private Optional status = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + public Builder updatedSince(OffsetDateTime updatedSince) { + Utils.checkNotNull(updatedSince, "updatedSince"); + this.updatedSince = Optional.ofNullable(updatedSince); + return this; + } + + public Builder updatedSince(Optional updatedSince) { + Utils.checkNotNull(updatedSince, "updatedSince"); + this.updatedSince = updatedSince; + return this; + } + + + public Builder status(ExpenseCategoriesFilterStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public ExpenseCategoriesFilter build() { + + return new ExpenseCategoriesFilter( + updatedSince, status); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseCategoriesFilterStatus.java b/src/main/java/com/apideck/unify/models/components/ExpenseCategoriesFilterStatus.java new file mode 100644 index 000000000..4fb635216 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ExpenseCategoriesFilterStatus.java @@ -0,0 +1,127 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.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 ExpenseCategoriesFilterStatus { + + public static final ExpenseCategoriesFilterStatus ACTIVE = new ExpenseCategoriesFilterStatus("active"); + public static final ExpenseCategoriesFilterStatus INACTIVE = new ExpenseCategoriesFilterStatus("inactive"); + + // 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 ExpenseCategoriesFilterStatus(String value) { + this.value = value; + } + + /** + * Returns a ExpenseCategoriesFilterStatus 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 ExpenseCategoriesFilterStatus + */ + @JsonCreator + public static ExpenseCategoriesFilterStatus of(String value) { + synchronized (ExpenseCategoriesFilterStatus.class) { + return values.computeIfAbsent(value, v -> new ExpenseCategoriesFilterStatus(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; + ExpenseCategoriesFilterStatus other = (ExpenseCategoriesFilterStatus) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "ExpenseCategoriesFilterStatus [value=" + value + "]"; + } + + // return an array just like an enum + public static ExpenseCategoriesFilterStatus[] values() { + synchronized (ExpenseCategoriesFilterStatus.class) { + return values.values().toArray(new ExpenseCategoriesFilterStatus[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("active", ACTIVE); + map.put("inactive", INACTIVE); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("active", ExpenseCategoriesFilterStatusEnum.ACTIVE); + map.put("inactive", ExpenseCategoriesFilterStatusEnum.INACTIVE); + return map; + } + + + public enum ExpenseCategoriesFilterStatusEnum { + + ACTIVE("active"), + INACTIVE("inactive"),; + + private final String value; + + private ExpenseCategoriesFilterStatusEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} + diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseCategory.java b/src/main/java/com/apideck/unify/models/components/ExpenseCategory.java new file mode 100644 index 000000000..b3e65e145 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ExpenseCategory.java @@ -0,0 +1,987 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Boolean; +import java.lang.Double; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ExpenseCategory { + /** + * A unique identifier for an object. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Id to be displayed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("display_id") + private JsonNullable displayId; + + /** + * The name of the expense category. + */ + @JsonProperty("name") + private String name; + + /** + * The code or external identifier of the expense category. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("code") + private JsonNullable code; + + /** + * The description of the expense category. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * The status of the expense category. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private JsonNullable status; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("account") + private JsonNullable account; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("offset_account") + private JsonNullable offsetAccount; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tax_rate") + private Optional taxRate; + + /** + * Whether the expense category requires rate/quantity entry (e.g. mileage at $/mile). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("rate_required") + private JsonNullable rateRequired; + + /** + * Default rate when rate_required is true (e.g. 0.67 for mileage). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("default_rate") + private JsonNullable defaultRate; + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("custom_mappings") + private JsonNullable> customMappings; + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("row_version") + private JsonNullable rowVersion; + + /** + * The date and time when the object was last updated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("updated_at") + private JsonNullable updatedAt; + + /** + * The date and time when the object was created. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_at") + private JsonNullable createdAt; + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("pass_through") + private Optional> passThrough; + + @JsonCreator + public ExpenseCategory( + @JsonProperty("id") Optional id, + @JsonProperty("display_id") JsonNullable displayId, + @JsonProperty("name") String name, + @JsonProperty("code") JsonNullable code, + @JsonProperty("description") JsonNullable description, + @JsonProperty("status") JsonNullable status, + @JsonProperty("account") JsonNullable account, + @JsonProperty("offset_account") JsonNullable offsetAccount, + @JsonProperty("tax_rate") Optional taxRate, + @JsonProperty("rate_required") JsonNullable rateRequired, + @JsonProperty("default_rate") JsonNullable defaultRate, + @JsonProperty("custom_mappings") JsonNullable> customMappings, + @JsonProperty("row_version") JsonNullable rowVersion, + @JsonProperty("updated_at") JsonNullable updatedAt, + @JsonProperty("created_at") JsonNullable createdAt, + @JsonProperty("pass_through") Optional> passThrough) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(displayId, "displayId"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(account, "account"); + Utils.checkNotNull(offsetAccount, "offsetAccount"); + Utils.checkNotNull(taxRate, "taxRate"); + Utils.checkNotNull(rateRequired, "rateRequired"); + Utils.checkNotNull(defaultRate, "defaultRate"); + Utils.checkNotNull(customMappings, "customMappings"); + Utils.checkNotNull(rowVersion, "rowVersion"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(passThrough, "passThrough"); + this.id = id; + this.displayId = displayId; + this.name = name; + this.code = code; + this.description = description; + this.status = status; + this.account = account; + this.offsetAccount = offsetAccount; + this.taxRate = taxRate; + this.rateRequired = rateRequired; + this.defaultRate = defaultRate; + this.customMappings = customMappings; + this.rowVersion = rowVersion; + this.updatedAt = updatedAt; + this.createdAt = createdAt; + this.passThrough = passThrough; + } + + public ExpenseCategory( + String name) { + this(Optional.empty(), JsonNullable.undefined(), name, + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + Optional.empty()); + } + + /** + * A unique identifier for an object. + */ + @JsonIgnore + public Optional id() { + return id; + } + + /** + * Id to be displayed. + */ + @JsonIgnore + public JsonNullable displayId() { + return displayId; + } + + /** + * The name of the expense category. + */ + @JsonIgnore + public String name() { + return name; + } + + /** + * The code or external identifier of the expense category. + */ + @JsonIgnore + public JsonNullable code() { + return code; + } + + /** + * The description of the expense category. + */ + @JsonIgnore + public JsonNullable description() { + return description; + } + + /** + * The status of the expense category. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable status() { + return (JsonNullable) status; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable account() { + return (JsonNullable) account; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable offsetAccount() { + return (JsonNullable) offsetAccount; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional taxRate() { + return (Optional) taxRate; + } + + /** + * Whether the expense category requires rate/quantity entry (e.g. mileage at $/mile). + */ + @JsonIgnore + public JsonNullable rateRequired() { + return rateRequired; + } + + /** + * Default rate when rate_required is true (e.g. 0.67 for mileage). + */ + @JsonIgnore + public JsonNullable defaultRate() { + return defaultRate; + } + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> customMappings() { + return (JsonNullable>) customMappings; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + @JsonIgnore + public JsonNullable rowVersion() { + return rowVersion; + } + + /** + * The date and time when the object was last updated. + */ + @JsonIgnore + public JsonNullable updatedAt() { + return updatedAt; + } + + /** + * The date and time when the object was created. + */ + @JsonIgnore + public JsonNullable createdAt() { + return createdAt; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> passThrough() { + return (Optional>) passThrough; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * A unique identifier for an object. + */ + public ExpenseCategory withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + + /** + * A unique identifier for an object. + */ + public ExpenseCategory withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Id to be displayed. + */ + public ExpenseCategory withDisplayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public ExpenseCategory withDisplayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + /** + * The name of the expense category. + */ + public ExpenseCategory withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The code or external identifier of the expense category. + */ + public ExpenseCategory withCode(String code) { + Utils.checkNotNull(code, "code"); + this.code = JsonNullable.of(code); + return this; + } + + /** + * The code or external identifier of the expense category. + */ + public ExpenseCategory withCode(JsonNullable code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + /** + * The description of the expense category. + */ + public ExpenseCategory withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * The description of the expense category. + */ + public ExpenseCategory withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The status of the expense category. + */ + public ExpenseCategory withStatus(ExpenseCategoryStatus status) { + Utils.checkNotNull(status, "status"); + this.status = JsonNullable.of(status); + return this; + } + + /** + * The status of the expense category. + */ + public ExpenseCategory withStatus(JsonNullable status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public ExpenseCategory withAccount(LinkedLedgerAccount account) { + Utils.checkNotNull(account, "account"); + this.account = JsonNullable.of(account); + return this; + } + + public ExpenseCategory withAccount(JsonNullable account) { + Utils.checkNotNull(account, "account"); + this.account = account; + return this; + } + + public ExpenseCategory withOffsetAccount(LinkedLedgerAccount offsetAccount) { + Utils.checkNotNull(offsetAccount, "offsetAccount"); + this.offsetAccount = JsonNullable.of(offsetAccount); + return this; + } + + public ExpenseCategory withOffsetAccount(JsonNullable offsetAccount) { + Utils.checkNotNull(offsetAccount, "offsetAccount"); + this.offsetAccount = offsetAccount; + return this; + } + + public ExpenseCategory withTaxRate(LinkedTaxRate taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + + public ExpenseCategory withTaxRate(Optional taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = taxRate; + return this; + } + + /** + * Whether the expense category requires rate/quantity entry (e.g. mileage at $/mile). + */ + public ExpenseCategory withRateRequired(boolean rateRequired) { + Utils.checkNotNull(rateRequired, "rateRequired"); + this.rateRequired = JsonNullable.of(rateRequired); + return this; + } + + /** + * Whether the expense category requires rate/quantity entry (e.g. mileage at $/mile). + */ + public ExpenseCategory withRateRequired(JsonNullable rateRequired) { + Utils.checkNotNull(rateRequired, "rateRequired"); + this.rateRequired = rateRequired; + return this; + } + + /** + * Default rate when rate_required is true (e.g. 0.67 for mileage). + */ + public ExpenseCategory withDefaultRate(double defaultRate) { + Utils.checkNotNull(defaultRate, "defaultRate"); + this.defaultRate = JsonNullable.of(defaultRate); + return this; + } + + /** + * Default rate when rate_required is true (e.g. 0.67 for mileage). + */ + public ExpenseCategory withDefaultRate(JsonNullable defaultRate) { + Utils.checkNotNull(defaultRate, "defaultRate"); + this.defaultRate = defaultRate; + return this; + } + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + public ExpenseCategory withCustomMappings(Map customMappings) { + Utils.checkNotNull(customMappings, "customMappings"); + this.customMappings = JsonNullable.of(customMappings); + return this; + } + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + public ExpenseCategory withCustomMappings(JsonNullable> customMappings) { + Utils.checkNotNull(customMappings, "customMappings"); + this.customMappings = customMappings; + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public ExpenseCategory withRowVersion(String rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = JsonNullable.of(rowVersion); + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public ExpenseCategory withRowVersion(JsonNullable rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = rowVersion; + return this; + } + + /** + * The date and time when the object was last updated. + */ + public ExpenseCategory withUpdatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = JsonNullable.of(updatedAt); + return this; + } + + /** + * The date and time when the object was last updated. + */ + public ExpenseCategory withUpdatedAt(JsonNullable updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * The date and time when the object was created. + */ + public ExpenseCategory withCreatedAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = JsonNullable.of(createdAt); + return this; + } + + /** + * The date and time when the object was created. + */ + public ExpenseCategory withCreatedAt(JsonNullable createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public ExpenseCategory withPassThrough(List passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = Optional.ofNullable(passThrough); + return this; + } + + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public ExpenseCategory withPassThrough(Optional> passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = passThrough; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExpenseCategory other = (ExpenseCategory) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.displayId, other.displayId) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.account, other.account) && + Utils.enhancedDeepEquals(this.offsetAccount, other.offsetAccount) && + Utils.enhancedDeepEquals(this.taxRate, other.taxRate) && + Utils.enhancedDeepEquals(this.rateRequired, other.rateRequired) && + Utils.enhancedDeepEquals(this.defaultRate, other.defaultRate) && + Utils.enhancedDeepEquals(this.customMappings, other.customMappings) && + Utils.enhancedDeepEquals(this.rowVersion, other.rowVersion) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.passThrough, other.passThrough); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, displayId, name, + code, description, status, + account, offsetAccount, taxRate, + rateRequired, defaultRate, customMappings, + rowVersion, updatedAt, createdAt, + passThrough); + } + + @Override + public String toString() { + return Utils.toString(ExpenseCategory.class, + "id", id, + "displayId", displayId, + "name", name, + "code", code, + "description", description, + "status", status, + "account", account, + "offsetAccount", offsetAccount, + "taxRate", taxRate, + "rateRequired", rateRequired, + "defaultRate", defaultRate, + "customMappings", customMappings, + "rowVersion", rowVersion, + "updatedAt", updatedAt, + "createdAt", createdAt, + "passThrough", passThrough); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional id = Optional.empty(); + + private JsonNullable displayId = JsonNullable.undefined(); + + private String name; + + private JsonNullable code = JsonNullable.undefined(); + + private JsonNullable description = JsonNullable.undefined(); + + private JsonNullable status = JsonNullable.undefined(); + + private JsonNullable account = JsonNullable.undefined(); + + private JsonNullable offsetAccount = JsonNullable.undefined(); + + private Optional taxRate = Optional.empty(); + + private JsonNullable rateRequired = JsonNullable.undefined(); + + private JsonNullable defaultRate = JsonNullable.undefined(); + + private JsonNullable> customMappings = JsonNullable.undefined(); + + private JsonNullable rowVersion = JsonNullable.undefined(); + + private JsonNullable updatedAt = JsonNullable.undefined(); + + private JsonNullable createdAt = JsonNullable.undefined(); + + private Optional> passThrough = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * A unique identifier for an object. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * A unique identifier for an object. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * Id to be displayed. + */ + public Builder displayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public Builder displayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + + /** + * The name of the expense category. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + + /** + * The code or external identifier of the expense category. + */ + public Builder code(String code) { + Utils.checkNotNull(code, "code"); + this.code = JsonNullable.of(code); + return this; + } + + /** + * The code or external identifier of the expense category. + */ + public Builder code(JsonNullable code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + + /** + * The description of the expense category. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * The description of the expense category. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + + /** + * The status of the expense category. + */ + public Builder status(ExpenseCategoryStatus status) { + Utils.checkNotNull(status, "status"); + this.status = JsonNullable.of(status); + return this; + } + + /** + * The status of the expense category. + */ + public Builder status(JsonNullable status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + public Builder account(LinkedLedgerAccount account) { + Utils.checkNotNull(account, "account"); + this.account = JsonNullable.of(account); + return this; + } + + public Builder account(JsonNullable account) { + Utils.checkNotNull(account, "account"); + this.account = account; + return this; + } + + + public Builder offsetAccount(LinkedLedgerAccount offsetAccount) { + Utils.checkNotNull(offsetAccount, "offsetAccount"); + this.offsetAccount = JsonNullable.of(offsetAccount); + return this; + } + + public Builder offsetAccount(JsonNullable offsetAccount) { + Utils.checkNotNull(offsetAccount, "offsetAccount"); + this.offsetAccount = offsetAccount; + return this; + } + + + public Builder taxRate(LinkedTaxRate taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + public Builder taxRate(Optional taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = taxRate; + return this; + } + + + /** + * Whether the expense category requires rate/quantity entry (e.g. mileage at $/mile). + */ + public Builder rateRequired(boolean rateRequired) { + Utils.checkNotNull(rateRequired, "rateRequired"); + this.rateRequired = JsonNullable.of(rateRequired); + return this; + } + + /** + * Whether the expense category requires rate/quantity entry (e.g. mileage at $/mile). + */ + public Builder rateRequired(JsonNullable rateRequired) { + Utils.checkNotNull(rateRequired, "rateRequired"); + this.rateRequired = rateRequired; + return this; + } + + + /** + * Default rate when rate_required is true (e.g. 0.67 for mileage). + */ + public Builder defaultRate(double defaultRate) { + Utils.checkNotNull(defaultRate, "defaultRate"); + this.defaultRate = JsonNullable.of(defaultRate); + return this; + } + + /** + * Default rate when rate_required is true (e.g. 0.67 for mileage). + */ + public Builder defaultRate(JsonNullable defaultRate) { + Utils.checkNotNull(defaultRate, "defaultRate"); + this.defaultRate = defaultRate; + return this; + } + + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + public Builder customMappings(Map customMappings) { + Utils.checkNotNull(customMappings, "customMappings"); + this.customMappings = JsonNullable.of(customMappings); + return this; + } + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + public Builder customMappings(JsonNullable> customMappings) { + Utils.checkNotNull(customMappings, "customMappings"); + this.customMappings = customMappings; + return this; + } + + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public Builder rowVersion(String rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = JsonNullable.of(rowVersion); + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public Builder rowVersion(JsonNullable rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = rowVersion; + return this; + } + + + /** + * The date and time when the object was last updated. + */ + public Builder updatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = JsonNullable.of(updatedAt); + return this; + } + + /** + * The date and time when the object was last updated. + */ + public Builder updatedAt(JsonNullable updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + + /** + * The date and time when the object was created. + */ + public Builder createdAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = JsonNullable.of(createdAt); + return this; + } + + /** + * The date and time when the object was created. + */ + public Builder createdAt(JsonNullable createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public Builder passThrough(List passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = Optional.ofNullable(passThrough); + return this; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public Builder passThrough(Optional> passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = passThrough; + return this; + } + + public ExpenseCategory build() { + + return new ExpenseCategory( + id, displayId, name, + code, description, status, + account, offsetAccount, taxRate, + rateRequired, defaultRate, customMappings, + rowVersion, updatedAt, createdAt, + passThrough); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseCategoryInput.java b/src/main/java/com/apideck/unify/models/components/ExpenseCategoryInput.java new file mode 100644 index 000000000..cd40a1dfb --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ExpenseCategoryInput.java @@ -0,0 +1,740 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Boolean; +import java.lang.Double; +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 ExpenseCategoryInput { + /** + * Id to be displayed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("display_id") + private JsonNullable displayId; + + /** + * The name of the expense category. + */ + @JsonProperty("name") + private String name; + + /** + * The code or external identifier of the expense category. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("code") + private JsonNullable code; + + /** + * The description of the expense category. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + /** + * The status of the expense category. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private JsonNullable status; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("account") + private JsonNullable account; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("offset_account") + private JsonNullable offsetAccount; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tax_rate") + private Optional taxRate; + + /** + * Whether the expense category requires rate/quantity entry (e.g. mileage at $/mile). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("rate_required") + private JsonNullable rateRequired; + + /** + * Default rate when rate_required is true (e.g. 0.67 for mileage). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("default_rate") + private JsonNullable defaultRate; + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("row_version") + private JsonNullable rowVersion; + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("pass_through") + private Optional> passThrough; + + @JsonCreator + public ExpenseCategoryInput( + @JsonProperty("display_id") JsonNullable displayId, + @JsonProperty("name") String name, + @JsonProperty("code") JsonNullable code, + @JsonProperty("description") JsonNullable description, + @JsonProperty("status") JsonNullable status, + @JsonProperty("account") JsonNullable account, + @JsonProperty("offset_account") JsonNullable offsetAccount, + @JsonProperty("tax_rate") Optional taxRate, + @JsonProperty("rate_required") JsonNullable rateRequired, + @JsonProperty("default_rate") JsonNullable defaultRate, + @JsonProperty("row_version") JsonNullable rowVersion, + @JsonProperty("pass_through") Optional> passThrough) { + Utils.checkNotNull(displayId, "displayId"); + Utils.checkNotNull(name, "name"); + Utils.checkNotNull(code, "code"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(account, "account"); + Utils.checkNotNull(offsetAccount, "offsetAccount"); + Utils.checkNotNull(taxRate, "taxRate"); + Utils.checkNotNull(rateRequired, "rateRequired"); + Utils.checkNotNull(defaultRate, "defaultRate"); + Utils.checkNotNull(rowVersion, "rowVersion"); + Utils.checkNotNull(passThrough, "passThrough"); + this.displayId = displayId; + this.name = name; + this.code = code; + this.description = description; + this.status = status; + this.account = account; + this.offsetAccount = offsetAccount; + this.taxRate = taxRate; + this.rateRequired = rateRequired; + this.defaultRate = defaultRate; + this.rowVersion = rowVersion; + this.passThrough = passThrough; + } + + public ExpenseCategoryInput( + String name) { + this(JsonNullable.undefined(), name, JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + } + + /** + * Id to be displayed. + */ + @JsonIgnore + public JsonNullable displayId() { + return displayId; + } + + /** + * The name of the expense category. + */ + @JsonIgnore + public String name() { + return name; + } + + /** + * The code or external identifier of the expense category. + */ + @JsonIgnore + public JsonNullable code() { + return code; + } + + /** + * The description of the expense category. + */ + @JsonIgnore + public JsonNullable description() { + return description; + } + + /** + * The status of the expense category. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable status() { + return (JsonNullable) status; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable account() { + return (JsonNullable) account; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable offsetAccount() { + return (JsonNullable) offsetAccount; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional taxRate() { + return (Optional) taxRate; + } + + /** + * Whether the expense category requires rate/quantity entry (e.g. mileage at $/mile). + */ + @JsonIgnore + public JsonNullable rateRequired() { + return rateRequired; + } + + /** + * Default rate when rate_required is true (e.g. 0.67 for mileage). + */ + @JsonIgnore + public JsonNullable defaultRate() { + return defaultRate; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + @JsonIgnore + public JsonNullable rowVersion() { + return rowVersion; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> passThrough() { + return (Optional>) passThrough; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Id to be displayed. + */ + public ExpenseCategoryInput withDisplayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public ExpenseCategoryInput withDisplayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + /** + * The name of the expense category. + */ + public ExpenseCategoryInput withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + /** + * The code or external identifier of the expense category. + */ + public ExpenseCategoryInput withCode(String code) { + Utils.checkNotNull(code, "code"); + this.code = JsonNullable.of(code); + return this; + } + + /** + * The code or external identifier of the expense category. + */ + public ExpenseCategoryInput withCode(JsonNullable code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + /** + * The description of the expense category. + */ + public ExpenseCategoryInput withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * The description of the expense category. + */ + public ExpenseCategoryInput withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + /** + * The status of the expense category. + */ + public ExpenseCategoryInput withStatus(ExpenseCategoryStatus status) { + Utils.checkNotNull(status, "status"); + this.status = JsonNullable.of(status); + return this; + } + + /** + * The status of the expense category. + */ + public ExpenseCategoryInput withStatus(JsonNullable status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + public ExpenseCategoryInput withAccount(LinkedLedgerAccount account) { + Utils.checkNotNull(account, "account"); + this.account = JsonNullable.of(account); + return this; + } + + public ExpenseCategoryInput withAccount(JsonNullable account) { + Utils.checkNotNull(account, "account"); + this.account = account; + return this; + } + + public ExpenseCategoryInput withOffsetAccount(LinkedLedgerAccount offsetAccount) { + Utils.checkNotNull(offsetAccount, "offsetAccount"); + this.offsetAccount = JsonNullable.of(offsetAccount); + return this; + } + + public ExpenseCategoryInput withOffsetAccount(JsonNullable offsetAccount) { + Utils.checkNotNull(offsetAccount, "offsetAccount"); + this.offsetAccount = offsetAccount; + return this; + } + + public ExpenseCategoryInput withTaxRate(LinkedTaxRateInput taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + + public ExpenseCategoryInput withTaxRate(Optional taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = taxRate; + return this; + } + + /** + * Whether the expense category requires rate/quantity entry (e.g. mileage at $/mile). + */ + public ExpenseCategoryInput withRateRequired(boolean rateRequired) { + Utils.checkNotNull(rateRequired, "rateRequired"); + this.rateRequired = JsonNullable.of(rateRequired); + return this; + } + + /** + * Whether the expense category requires rate/quantity entry (e.g. mileage at $/mile). + */ + public ExpenseCategoryInput withRateRequired(JsonNullable rateRequired) { + Utils.checkNotNull(rateRequired, "rateRequired"); + this.rateRequired = rateRequired; + return this; + } + + /** + * Default rate when rate_required is true (e.g. 0.67 for mileage). + */ + public ExpenseCategoryInput withDefaultRate(double defaultRate) { + Utils.checkNotNull(defaultRate, "defaultRate"); + this.defaultRate = JsonNullable.of(defaultRate); + return this; + } + + /** + * Default rate when rate_required is true (e.g. 0.67 for mileage). + */ + public ExpenseCategoryInput withDefaultRate(JsonNullable defaultRate) { + Utils.checkNotNull(defaultRate, "defaultRate"); + this.defaultRate = defaultRate; + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public ExpenseCategoryInput withRowVersion(String rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = JsonNullable.of(rowVersion); + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public ExpenseCategoryInput withRowVersion(JsonNullable rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = rowVersion; + return this; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public ExpenseCategoryInput withPassThrough(List passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = Optional.ofNullable(passThrough); + return this; + } + + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public ExpenseCategoryInput withPassThrough(Optional> passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = passThrough; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExpenseCategoryInput other = (ExpenseCategoryInput) o; + return + Utils.enhancedDeepEquals(this.displayId, other.displayId) && + Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.code, other.code) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.account, other.account) && + Utils.enhancedDeepEquals(this.offsetAccount, other.offsetAccount) && + Utils.enhancedDeepEquals(this.taxRate, other.taxRate) && + Utils.enhancedDeepEquals(this.rateRequired, other.rateRequired) && + Utils.enhancedDeepEquals(this.defaultRate, other.defaultRate) && + Utils.enhancedDeepEquals(this.rowVersion, other.rowVersion) && + Utils.enhancedDeepEquals(this.passThrough, other.passThrough); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + displayId, name, code, + description, status, account, + offsetAccount, taxRate, rateRequired, + defaultRate, rowVersion, passThrough); + } + + @Override + public String toString() { + return Utils.toString(ExpenseCategoryInput.class, + "displayId", displayId, + "name", name, + "code", code, + "description", description, + "status", status, + "account", account, + "offsetAccount", offsetAccount, + "taxRate", taxRate, + "rateRequired", rateRequired, + "defaultRate", defaultRate, + "rowVersion", rowVersion, + "passThrough", passThrough); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private JsonNullable displayId = JsonNullable.undefined(); + + private String name; + + private JsonNullable code = JsonNullable.undefined(); + + private JsonNullable description = JsonNullable.undefined(); + + private JsonNullable status = JsonNullable.undefined(); + + private JsonNullable account = JsonNullable.undefined(); + + private JsonNullable offsetAccount = JsonNullable.undefined(); + + private Optional taxRate = Optional.empty(); + + private JsonNullable rateRequired = JsonNullable.undefined(); + + private JsonNullable defaultRate = JsonNullable.undefined(); + + private JsonNullable rowVersion = JsonNullable.undefined(); + + private Optional> passThrough = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * Id to be displayed. + */ + public Builder displayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public Builder displayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + + /** + * The name of the expense category. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + + /** + * The code or external identifier of the expense category. + */ + public Builder code(String code) { + Utils.checkNotNull(code, "code"); + this.code = JsonNullable.of(code); + return this; + } + + /** + * The code or external identifier of the expense category. + */ + public Builder code(JsonNullable code) { + Utils.checkNotNull(code, "code"); + this.code = code; + return this; + } + + + /** + * The description of the expense category. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * The description of the expense category. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + + /** + * The status of the expense category. + */ + public Builder status(ExpenseCategoryStatus status) { + Utils.checkNotNull(status, "status"); + this.status = JsonNullable.of(status); + return this; + } + + /** + * The status of the expense category. + */ + public Builder status(JsonNullable status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + public Builder account(LinkedLedgerAccount account) { + Utils.checkNotNull(account, "account"); + this.account = JsonNullable.of(account); + return this; + } + + public Builder account(JsonNullable account) { + Utils.checkNotNull(account, "account"); + this.account = account; + return this; + } + + + public Builder offsetAccount(LinkedLedgerAccount offsetAccount) { + Utils.checkNotNull(offsetAccount, "offsetAccount"); + this.offsetAccount = JsonNullable.of(offsetAccount); + return this; + } + + public Builder offsetAccount(JsonNullable offsetAccount) { + Utils.checkNotNull(offsetAccount, "offsetAccount"); + this.offsetAccount = offsetAccount; + return this; + } + + + public Builder taxRate(LinkedTaxRateInput taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + public Builder taxRate(Optional taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = taxRate; + return this; + } + + + /** + * Whether the expense category requires rate/quantity entry (e.g. mileage at $/mile). + */ + public Builder rateRequired(boolean rateRequired) { + Utils.checkNotNull(rateRequired, "rateRequired"); + this.rateRequired = JsonNullable.of(rateRequired); + return this; + } + + /** + * Whether the expense category requires rate/quantity entry (e.g. mileage at $/mile). + */ + public Builder rateRequired(JsonNullable rateRequired) { + Utils.checkNotNull(rateRequired, "rateRequired"); + this.rateRequired = rateRequired; + return this; + } + + + /** + * Default rate when rate_required is true (e.g. 0.67 for mileage). + */ + public Builder defaultRate(double defaultRate) { + Utils.checkNotNull(defaultRate, "defaultRate"); + this.defaultRate = JsonNullable.of(defaultRate); + return this; + } + + /** + * Default rate when rate_required is true (e.g. 0.67 for mileage). + */ + public Builder defaultRate(JsonNullable defaultRate) { + Utils.checkNotNull(defaultRate, "defaultRate"); + this.defaultRate = defaultRate; + return this; + } + + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public Builder rowVersion(String rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = JsonNullable.of(rowVersion); + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public Builder rowVersion(JsonNullable rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = rowVersion; + return this; + } + + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public Builder passThrough(List passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = Optional.ofNullable(passThrough); + return this; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public Builder passThrough(Optional> passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = passThrough; + return this; + } + + public ExpenseCategoryInput build() { + + return new ExpenseCategoryInput( + displayId, name, code, + description, status, account, + offsetAccount, taxRate, rateRequired, + defaultRate, rowVersion, passThrough); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseCategoryStatus.java b/src/main/java/com/apideck/unify/models/components/ExpenseCategoryStatus.java new file mode 100644 index 000000000..df5de4813 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ExpenseCategoryStatus.java @@ -0,0 +1,132 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.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. + */ +/** + * ExpenseCategoryStatus + * + *

The status of the expense category. + */ +public class ExpenseCategoryStatus { + + public static final ExpenseCategoryStatus ACTIVE = new ExpenseCategoryStatus("active"); + public static final ExpenseCategoryStatus INACTIVE = new ExpenseCategoryStatus("inactive"); + + // 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 ExpenseCategoryStatus(String value) { + this.value = value; + } + + /** + * Returns a ExpenseCategoryStatus 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 ExpenseCategoryStatus + */ + @JsonCreator + public static ExpenseCategoryStatus of(String value) { + synchronized (ExpenseCategoryStatus.class) { + return values.computeIfAbsent(value, v -> new ExpenseCategoryStatus(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; + ExpenseCategoryStatus other = (ExpenseCategoryStatus) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "ExpenseCategoryStatus [value=" + value + "]"; + } + + // return an array just like an enum + public static ExpenseCategoryStatus[] values() { + synchronized (ExpenseCategoryStatus.class) { + return values.values().toArray(new ExpenseCategoryStatus[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("active", ACTIVE); + map.put("inactive", INACTIVE); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("active", ExpenseCategoryStatusEnum.ACTIVE); + map.put("inactive", ExpenseCategoryStatusEnum.INACTIVE); + return map; + } + + + public enum ExpenseCategoryStatusEnum { + + ACTIVE("active"), + INACTIVE("inactive"),; + + private final String value; + + private ExpenseCategoryStatusEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} + diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseReport.java b/src/main/java/com/apideck/unify/models/components/ExpenseReport.java new file mode 100644 index 000000000..43017e8f4 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ExpenseReport.java @@ -0,0 +1,1849 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Boolean; +import java.lang.Double; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ExpenseReport { + /** + * A unique identifier for an object. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Id to be displayed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("display_id") + private JsonNullable displayId; + + /** + * The expense report number. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("number") + private JsonNullable number; + + /** + * Title or purpose of the expense report. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("title") + private JsonNullable title; + + /** + * The employee who submitted the expense report. + */ + @JsonProperty("employee") + private ExpenseReportEmployee employee; + + /** + * The status of the expense report. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private JsonNullable status; + + /** + * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + */ + @JsonInclude(Include.ALWAYS) + @JsonProperty("transaction_date") + private Optional transactionDate; + + /** + * The date the expense report was posted to the general ledger. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("posting_date") + private JsonNullable postingDate; + + /** + * Date when reimbursement is due. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("due_date") + private JsonNullable dueDate; + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private JsonNullable currency; + + /** + * Currency Exchange Rate at the time entity was recorded/generated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency_rate") + private JsonNullable currencyRate; + + /** + * Subtotal amount, normally before tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sub_total") + private JsonNullable subTotal; + + /** + * Total tax amount applied to this transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("total_tax") + private JsonNullable totalTax; + + /** + * Total amount of all expense lines including tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("total_amount") + private JsonNullable totalAmount; + + /** + * Total reimbursable amount (may differ from total if some expenses are non-reimbursable). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reimbursable_amount") + private JsonNullable reimbursableAmount; + + /** + * The memo of the expense report. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("memo") + private JsonNullable memo; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("department") + private JsonNullable department; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("location") + private JsonNullable location; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("account") + private JsonNullable account; + + /** + * The accounting period the expense report is posted to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accounting_period") + private JsonNullable accountingPeriod; + + /** + * Expense line items linked to this expense report. + */ + @JsonProperty("line_items") + private List lineItems; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subsidiary") + private JsonNullable subsidiary; + + /** + * A list of linked tracking categories. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tracking_categories") + private JsonNullable> trackingCategories; + + /** + * Amounts are including tax + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tax_inclusive") + private JsonNullable taxInclusive; + + /** + * The person who approved the expense report. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("approved_by") + private JsonNullable approvedBy; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("custom_fields") + private Optional> customFields; + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("custom_mappings") + private JsonNullable> customMappings; + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("row_version") + private JsonNullable rowVersion; + + /** + * The date and time when the object was last updated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("updated_at") + private JsonNullable updatedAt; + + /** + * The date and time when the object was created. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("created_at") + private JsonNullable createdAt; + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("pass_through") + private Optional> passThrough; + + @JsonCreator + public ExpenseReport( + @JsonProperty("id") Optional id, + @JsonProperty("display_id") JsonNullable displayId, + @JsonProperty("number") JsonNullable number, + @JsonProperty("title") JsonNullable title, + @JsonProperty("employee") ExpenseReportEmployee employee, + @JsonProperty("status") JsonNullable status, + @JsonProperty("transaction_date") Optional transactionDate, + @JsonProperty("posting_date") JsonNullable postingDate, + @JsonProperty("due_date") JsonNullable dueDate, + @JsonProperty("currency") JsonNullable currency, + @JsonProperty("currency_rate") JsonNullable currencyRate, + @JsonProperty("sub_total") JsonNullable subTotal, + @JsonProperty("total_tax") JsonNullable totalTax, + @JsonProperty("total_amount") JsonNullable totalAmount, + @JsonProperty("reimbursable_amount") JsonNullable reimbursableAmount, + @JsonProperty("memo") JsonNullable memo, + @JsonProperty("department") JsonNullable department, + @JsonProperty("location") JsonNullable location, + @JsonProperty("account") JsonNullable account, + @JsonProperty("accounting_period") JsonNullable accountingPeriod, + @JsonProperty("line_items") List lineItems, + @JsonProperty("subsidiary") JsonNullable subsidiary, + @JsonProperty("tracking_categories") JsonNullable> trackingCategories, + @JsonProperty("tax_inclusive") JsonNullable taxInclusive, + @JsonProperty("approved_by") JsonNullable approvedBy, + @JsonProperty("custom_fields") Optional> customFields, + @JsonProperty("custom_mappings") JsonNullable> customMappings, + @JsonProperty("row_version") JsonNullable rowVersion, + @JsonProperty("updated_at") JsonNullable updatedAt, + @JsonProperty("created_at") JsonNullable createdAt, + @JsonProperty("pass_through") Optional> passThrough) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(displayId, "displayId"); + Utils.checkNotNull(number, "number"); + Utils.checkNotNull(title, "title"); + Utils.checkNotNull(employee, "employee"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(transactionDate, "transactionDate"); + Utils.checkNotNull(postingDate, "postingDate"); + Utils.checkNotNull(dueDate, "dueDate"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(totalTax, "totalTax"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(reimbursableAmount, "reimbursableAmount"); + Utils.checkNotNull(memo, "memo"); + Utils.checkNotNull(department, "department"); + Utils.checkNotNull(location, "location"); + Utils.checkNotNull(account, "account"); + Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + Utils.checkNotNull(lineItems, "lineItems"); + Utils.checkNotNull(subsidiary, "subsidiary"); + Utils.checkNotNull(trackingCategories, "trackingCategories"); + Utils.checkNotNull(taxInclusive, "taxInclusive"); + Utils.checkNotNull(approvedBy, "approvedBy"); + Utils.checkNotNull(customFields, "customFields"); + Utils.checkNotNull(customMappings, "customMappings"); + Utils.checkNotNull(rowVersion, "rowVersion"); + Utils.checkNotNull(updatedAt, "updatedAt"); + Utils.checkNotNull(createdAt, "createdAt"); + Utils.checkNotNull(passThrough, "passThrough"); + this.id = id; + this.displayId = displayId; + this.number = number; + this.title = title; + this.employee = employee; + this.status = status; + this.transactionDate = transactionDate; + this.postingDate = postingDate; + this.dueDate = dueDate; + this.currency = currency; + this.currencyRate = currencyRate; + this.subTotal = subTotal; + this.totalTax = totalTax; + this.totalAmount = totalAmount; + this.reimbursableAmount = reimbursableAmount; + this.memo = memo; + this.department = department; + this.location = location; + this.account = account; + this.accountingPeriod = accountingPeriod; + this.lineItems = lineItems; + this.subsidiary = subsidiary; + this.trackingCategories = trackingCategories; + this.taxInclusive = taxInclusive; + this.approvedBy = approvedBy; + this.customFields = customFields; + this.customMappings = customMappings; + this.rowVersion = rowVersion; + this.updatedAt = updatedAt; + this.createdAt = createdAt; + this.passThrough = passThrough; + } + + public ExpenseReport( + ExpenseReportEmployee employee, + List lineItems) { + this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), employee, JsonNullable.undefined(), + Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), lineItems, + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + Optional.empty()); + } + + /** + * A unique identifier for an object. + */ + @JsonIgnore + public Optional id() { + return id; + } + + /** + * Id to be displayed. + */ + @JsonIgnore + public JsonNullable displayId() { + return displayId; + } + + /** + * The expense report number. + */ + @JsonIgnore + public JsonNullable number() { + return number; + } + + /** + * Title or purpose of the expense report. + */ + @JsonIgnore + public JsonNullable title() { + return title; + } + + /** + * The employee who submitted the expense report. + */ + @JsonIgnore + public ExpenseReportEmployee employee() { + return employee; + } + + /** + * The status of the expense report. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable status() { + return (JsonNullable) status; + } + + /** + * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + */ + @JsonIgnore + public Optional transactionDate() { + return transactionDate; + } + + /** + * The date the expense report was posted to the general ledger. + */ + @JsonIgnore + public JsonNullable postingDate() { + return postingDate; + } + + /** + * Date when reimbursement is due. + */ + @JsonIgnore + public JsonNullable dueDate() { + return dueDate; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable currency() { + return (JsonNullable) currency; + } + + /** + * Currency Exchange Rate at the time entity was recorded/generated. + */ + @JsonIgnore + public JsonNullable currencyRate() { + return currencyRate; + } + + /** + * Subtotal amount, normally before tax. + */ + @JsonIgnore + public JsonNullable subTotal() { + return subTotal; + } + + /** + * Total tax amount applied to this transaction. + */ + @JsonIgnore + public JsonNullable totalTax() { + return totalTax; + } + + /** + * Total amount of all expense lines including tax. + */ + @JsonIgnore + public JsonNullable totalAmount() { + return totalAmount; + } + + /** + * Total reimbursable amount (may differ from total if some expenses are non-reimbursable). + */ + @JsonIgnore + public JsonNullable reimbursableAmount() { + return reimbursableAmount; + } + + /** + * The memo of the expense report. + */ + @JsonIgnore + public JsonNullable memo() { + return memo; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable department() { + return (JsonNullable) department; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable location() { + return (JsonNullable) location; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable account() { + return (JsonNullable) account; + } + + /** + * The accounting period the expense report is posted to. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable accountingPeriod() { + return (JsonNullable) accountingPeriod; + } + + /** + * Expense line items linked to this expense report. + */ + @JsonIgnore + public List lineItems() { + return lineItems; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable subsidiary() { + return (JsonNullable) subsidiary; + } + + /** + * A list of linked tracking categories. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> trackingCategories() { + return (JsonNullable>) trackingCategories; + } + + /** + * Amounts are including tax + */ + @JsonIgnore + public JsonNullable taxInclusive() { + return taxInclusive; + } + + /** + * The person who approved the expense report. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable approvedBy() { + return (JsonNullable) approvedBy; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> customFields() { + return (Optional>) customFields; + } + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> customMappings() { + return (JsonNullable>) customMappings; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + @JsonIgnore + public JsonNullable rowVersion() { + return rowVersion; + } + + /** + * The date and time when the object was last updated. + */ + @JsonIgnore + public JsonNullable updatedAt() { + return updatedAt; + } + + /** + * The date and time when the object was created. + */ + @JsonIgnore + public JsonNullable createdAt() { + return createdAt; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> passThrough() { + return (Optional>) passThrough; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * A unique identifier for an object. + */ + public ExpenseReport withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + + /** + * A unique identifier for an object. + */ + public ExpenseReport withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Id to be displayed. + */ + public ExpenseReport withDisplayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public ExpenseReport withDisplayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + /** + * The expense report number. + */ + public ExpenseReport withNumber(String number) { + Utils.checkNotNull(number, "number"); + this.number = JsonNullable.of(number); + return this; + } + + /** + * The expense report number. + */ + public ExpenseReport withNumber(JsonNullable number) { + Utils.checkNotNull(number, "number"); + this.number = number; + return this; + } + + /** + * Title or purpose of the expense report. + */ + public ExpenseReport withTitle(String title) { + Utils.checkNotNull(title, "title"); + this.title = JsonNullable.of(title); + return this; + } + + /** + * Title or purpose of the expense report. + */ + public ExpenseReport withTitle(JsonNullable title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + /** + * The employee who submitted the expense report. + */ + public ExpenseReport withEmployee(ExpenseReportEmployee employee) { + Utils.checkNotNull(employee, "employee"); + this.employee = employee; + return this; + } + + /** + * The status of the expense report. + */ + public ExpenseReport withStatus(ExpenseReportStatus status) { + Utils.checkNotNull(status, "status"); + this.status = JsonNullable.of(status); + return this; + } + + /** + * The status of the expense report. + */ + public ExpenseReport withStatus(JsonNullable status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + */ + public ExpenseReport withTransactionDate(OffsetDateTime transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + + /** + * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + */ + public ExpenseReport withTransactionDate(Optional transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = transactionDate; + return this; + } + + /** + * The date the expense report was posted to the general ledger. + */ + public ExpenseReport withPostingDate(LocalDate postingDate) { + Utils.checkNotNull(postingDate, "postingDate"); + this.postingDate = JsonNullable.of(postingDate); + return this; + } + + /** + * The date the expense report was posted to the general ledger. + */ + public ExpenseReport withPostingDate(JsonNullable postingDate) { + Utils.checkNotNull(postingDate, "postingDate"); + this.postingDate = postingDate; + return this; + } + + /** + * Date when reimbursement is due. + */ + public ExpenseReport withDueDate(LocalDate dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = JsonNullable.of(dueDate); + return this; + } + + /** + * Date when reimbursement is due. + */ + public ExpenseReport withDueDate(JsonNullable dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public ExpenseReport withCurrency(Currency currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public ExpenseReport withCurrency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Currency Exchange Rate at the time entity was recorded/generated. + */ + public ExpenseReport withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Currency Exchange Rate at the time entity was recorded/generated. + */ + public ExpenseReport withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Subtotal amount, normally before tax. + */ + public ExpenseReport withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Subtotal amount, normally before tax. + */ + public ExpenseReport withSubTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Total tax amount applied to this transaction. + */ + public ExpenseReport withTotalTax(double totalTax) { + Utils.checkNotNull(totalTax, "totalTax"); + this.totalTax = JsonNullable.of(totalTax); + return this; + } + + /** + * Total tax amount applied to this transaction. + */ + public ExpenseReport withTotalTax(JsonNullable totalTax) { + Utils.checkNotNull(totalTax, "totalTax"); + this.totalTax = totalTax; + return this; + } + + /** + * Total amount of all expense lines including tax. + */ + public ExpenseReport withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * Total amount of all expense lines including tax. + */ + public ExpenseReport withTotalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Total reimbursable amount (may differ from total if some expenses are non-reimbursable). + */ + public ExpenseReport withReimbursableAmount(double reimbursableAmount) { + Utils.checkNotNull(reimbursableAmount, "reimbursableAmount"); + this.reimbursableAmount = JsonNullable.of(reimbursableAmount); + return this; + } + + /** + * Total reimbursable amount (may differ from total if some expenses are non-reimbursable). + */ + public ExpenseReport withReimbursableAmount(JsonNullable reimbursableAmount) { + Utils.checkNotNull(reimbursableAmount, "reimbursableAmount"); + this.reimbursableAmount = reimbursableAmount; + return this; + } + + /** + * The memo of the expense report. + */ + public ExpenseReport withMemo(String memo) { + Utils.checkNotNull(memo, "memo"); + this.memo = JsonNullable.of(memo); + return this; + } + + /** + * The memo of the expense report. + */ + public ExpenseReport withMemo(JsonNullable memo) { + Utils.checkNotNull(memo, "memo"); + this.memo = memo; + return this; + } + + public ExpenseReport withDepartment(LinkedDepartment department) { + Utils.checkNotNull(department, "department"); + this.department = JsonNullable.of(department); + return this; + } + + public ExpenseReport withDepartment(JsonNullable department) { + Utils.checkNotNull(department, "department"); + this.department = department; + return this; + } + + public ExpenseReport withLocation(LinkedLocation location) { + Utils.checkNotNull(location, "location"); + this.location = JsonNullable.of(location); + return this; + } + + public ExpenseReport withLocation(JsonNullable location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + public ExpenseReport withAccount(LinkedLedgerAccount account) { + Utils.checkNotNull(account, "account"); + this.account = JsonNullable.of(account); + return this; + } + + public ExpenseReport withAccount(JsonNullable account) { + Utils.checkNotNull(account, "account"); + this.account = account; + return this; + } + + /** + * The accounting period the expense report is posted to. + */ + public ExpenseReport withAccountingPeriod(AccountingPeriod accountingPeriod) { + Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + this.accountingPeriod = JsonNullable.of(accountingPeriod); + return this; + } + + /** + * The accounting period the expense report is posted to. + */ + public ExpenseReport withAccountingPeriod(JsonNullable accountingPeriod) { + Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + this.accountingPeriod = accountingPeriod; + return this; + } + + /** + * Expense line items linked to this expense report. + */ + public ExpenseReport withLineItems(List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public ExpenseReport withSubsidiary(LinkedSubsidiary subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = JsonNullable.of(subsidiary); + return this; + } + + public ExpenseReport withSubsidiary(JsonNullable subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = subsidiary; + return this; + } + + /** + * A list of linked tracking categories. + */ + public ExpenseReport withTrackingCategories(List trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = JsonNullable.of(trackingCategories); + return this; + } + + /** + * A list of linked tracking categories. + */ + public ExpenseReport withTrackingCategories(JsonNullable> trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = trackingCategories; + return this; + } + + /** + * Amounts are including tax + */ + public ExpenseReport withTaxInclusive(boolean taxInclusive) { + Utils.checkNotNull(taxInclusive, "taxInclusive"); + this.taxInclusive = JsonNullable.of(taxInclusive); + return this; + } + + /** + * Amounts are including tax + */ + public ExpenseReport withTaxInclusive(JsonNullable taxInclusive) { + Utils.checkNotNull(taxInclusive, "taxInclusive"); + this.taxInclusive = taxInclusive; + return this; + } + + /** + * The person who approved the expense report. + */ + public ExpenseReport withApprovedBy(ApprovedBy approvedBy) { + Utils.checkNotNull(approvedBy, "approvedBy"); + this.approvedBy = JsonNullable.of(approvedBy); + return this; + } + + /** + * The person who approved the expense report. + */ + public ExpenseReport withApprovedBy(JsonNullable approvedBy) { + Utils.checkNotNull(approvedBy, "approvedBy"); + this.approvedBy = approvedBy; + return this; + } + + public ExpenseReport withCustomFields(List customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = Optional.ofNullable(customFields); + return this; + } + + + public ExpenseReport withCustomFields(Optional> customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = customFields; + return this; + } + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + public ExpenseReport withCustomMappings(Map customMappings) { + Utils.checkNotNull(customMappings, "customMappings"); + this.customMappings = JsonNullable.of(customMappings); + return this; + } + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + public ExpenseReport withCustomMappings(JsonNullable> customMappings) { + Utils.checkNotNull(customMappings, "customMappings"); + this.customMappings = customMappings; + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public ExpenseReport withRowVersion(String rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = JsonNullable.of(rowVersion); + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public ExpenseReport withRowVersion(JsonNullable rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = rowVersion; + return this; + } + + /** + * The date and time when the object was last updated. + */ + public ExpenseReport withUpdatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = JsonNullable.of(updatedAt); + return this; + } + + /** + * The date and time when the object was last updated. + */ + public ExpenseReport withUpdatedAt(JsonNullable updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + /** + * The date and time when the object was created. + */ + public ExpenseReport withCreatedAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = JsonNullable.of(createdAt); + return this; + } + + /** + * The date and time when the object was created. + */ + public ExpenseReport withCreatedAt(JsonNullable createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public ExpenseReport withPassThrough(List passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = Optional.ofNullable(passThrough); + return this; + } + + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public ExpenseReport withPassThrough(Optional> passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = passThrough; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExpenseReport other = (ExpenseReport) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.displayId, other.displayId) && + Utils.enhancedDeepEquals(this.number, other.number) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.employee, other.employee) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.transactionDate, other.transactionDate) && + Utils.enhancedDeepEquals(this.postingDate, other.postingDate) && + Utils.enhancedDeepEquals(this.dueDate, other.dueDate) && + Utils.enhancedDeepEquals(this.currency, other.currency) && + Utils.enhancedDeepEquals(this.currencyRate, other.currencyRate) && + Utils.enhancedDeepEquals(this.subTotal, other.subTotal) && + Utils.enhancedDeepEquals(this.totalTax, other.totalTax) && + Utils.enhancedDeepEquals(this.totalAmount, other.totalAmount) && + Utils.enhancedDeepEquals(this.reimbursableAmount, other.reimbursableAmount) && + Utils.enhancedDeepEquals(this.memo, other.memo) && + Utils.enhancedDeepEquals(this.department, other.department) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.account, other.account) && + Utils.enhancedDeepEquals(this.accountingPeriod, other.accountingPeriod) && + Utils.enhancedDeepEquals(this.lineItems, other.lineItems) && + Utils.enhancedDeepEquals(this.subsidiary, other.subsidiary) && + Utils.enhancedDeepEquals(this.trackingCategories, other.trackingCategories) && + Utils.enhancedDeepEquals(this.taxInclusive, other.taxInclusive) && + Utils.enhancedDeepEquals(this.approvedBy, other.approvedBy) && + Utils.enhancedDeepEquals(this.customFields, other.customFields) && + Utils.enhancedDeepEquals(this.customMappings, other.customMappings) && + Utils.enhancedDeepEquals(this.rowVersion, other.rowVersion) && + Utils.enhancedDeepEquals(this.updatedAt, other.updatedAt) && + Utils.enhancedDeepEquals(this.createdAt, other.createdAt) && + Utils.enhancedDeepEquals(this.passThrough, other.passThrough); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, displayId, number, + title, employee, status, + transactionDate, postingDate, dueDate, + currency, currencyRate, subTotal, + totalTax, totalAmount, reimbursableAmount, + memo, department, location, + account, accountingPeriod, lineItems, + subsidiary, trackingCategories, taxInclusive, + approvedBy, customFields, customMappings, + rowVersion, updatedAt, createdAt, + passThrough); + } + + @Override + public String toString() { + return Utils.toString(ExpenseReport.class, + "id", id, + "displayId", displayId, + "number", number, + "title", title, + "employee", employee, + "status", status, + "transactionDate", transactionDate, + "postingDate", postingDate, + "dueDate", dueDate, + "currency", currency, + "currencyRate", currencyRate, + "subTotal", subTotal, + "totalTax", totalTax, + "totalAmount", totalAmount, + "reimbursableAmount", reimbursableAmount, + "memo", memo, + "department", department, + "location", location, + "account", account, + "accountingPeriod", accountingPeriod, + "lineItems", lineItems, + "subsidiary", subsidiary, + "trackingCategories", trackingCategories, + "taxInclusive", taxInclusive, + "approvedBy", approvedBy, + "customFields", customFields, + "customMappings", customMappings, + "rowVersion", rowVersion, + "updatedAt", updatedAt, + "createdAt", createdAt, + "passThrough", passThrough); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional id = Optional.empty(); + + private JsonNullable displayId = JsonNullable.undefined(); + + private JsonNullable number = JsonNullable.undefined(); + + private JsonNullable title = JsonNullable.undefined(); + + private ExpenseReportEmployee employee; + + private JsonNullable status = JsonNullable.undefined(); + + private Optional transactionDate = Optional.empty(); + + private JsonNullable postingDate = JsonNullable.undefined(); + + private JsonNullable dueDate = JsonNullable.undefined(); + + private JsonNullable currency = JsonNullable.undefined(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private JsonNullable subTotal = JsonNullable.undefined(); + + private JsonNullable totalTax = JsonNullable.undefined(); + + private JsonNullable totalAmount = JsonNullable.undefined(); + + private JsonNullable reimbursableAmount = JsonNullable.undefined(); + + private JsonNullable memo = JsonNullable.undefined(); + + private JsonNullable department = JsonNullable.undefined(); + + private JsonNullable location = JsonNullable.undefined(); + + private JsonNullable account = JsonNullable.undefined(); + + private JsonNullable accountingPeriod = JsonNullable.undefined(); + + private List lineItems; + + private JsonNullable subsidiary = JsonNullable.undefined(); + + private JsonNullable> trackingCategories = JsonNullable.undefined(); + + private JsonNullable taxInclusive = JsonNullable.undefined(); + + private JsonNullable approvedBy = JsonNullable.undefined(); + + private Optional> customFields = Optional.empty(); + + private JsonNullable> customMappings = JsonNullable.undefined(); + + private JsonNullable rowVersion = JsonNullable.undefined(); + + private JsonNullable updatedAt = JsonNullable.undefined(); + + private JsonNullable createdAt = JsonNullable.undefined(); + + private Optional> passThrough = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * A unique identifier for an object. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * A unique identifier for an object. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * Id to be displayed. + */ + public Builder displayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public Builder displayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + + /** + * The expense report number. + */ + public Builder number(String number) { + Utils.checkNotNull(number, "number"); + this.number = JsonNullable.of(number); + return this; + } + + /** + * The expense report number. + */ + public Builder number(JsonNullable number) { + Utils.checkNotNull(number, "number"); + this.number = number; + return this; + } + + + /** + * Title or purpose of the expense report. + */ + public Builder title(String title) { + Utils.checkNotNull(title, "title"); + this.title = JsonNullable.of(title); + return this; + } + + /** + * Title or purpose of the expense report. + */ + public Builder title(JsonNullable title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + + /** + * The employee who submitted the expense report. + */ + public Builder employee(ExpenseReportEmployee employee) { + Utils.checkNotNull(employee, "employee"); + this.employee = employee; + return this; + } + + + /** + * The status of the expense report. + */ + public Builder status(ExpenseReportStatus status) { + Utils.checkNotNull(status, "status"); + this.status = JsonNullable.of(status); + return this; + } + + /** + * The status of the expense report. + */ + public Builder status(JsonNullable status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + */ + public Builder transactionDate(OffsetDateTime transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + /** + * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + */ + public Builder transactionDate(Optional transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = transactionDate; + return this; + } + + + /** + * The date the expense report was posted to the general ledger. + */ + public Builder postingDate(LocalDate postingDate) { + Utils.checkNotNull(postingDate, "postingDate"); + this.postingDate = JsonNullable.of(postingDate); + return this; + } + + /** + * The date the expense report was posted to the general ledger. + */ + public Builder postingDate(JsonNullable postingDate) { + Utils.checkNotNull(postingDate, "postingDate"); + this.postingDate = postingDate; + return this; + } + + + /** + * Date when reimbursement is due. + */ + public Builder dueDate(LocalDate dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = JsonNullable.of(dueDate); + return this; + } + + /** + * Date when reimbursement is due. + */ + public Builder dueDate(JsonNullable dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public Builder currency(Currency currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public Builder currency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + + /** + * Currency Exchange Rate at the time entity was recorded/generated. + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Currency Exchange Rate at the time entity was recorded/generated. + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + + /** + * Subtotal amount, normally before tax. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Subtotal amount, normally before tax. + */ + public Builder subTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + + /** + * Total tax amount applied to this transaction. + */ + public Builder totalTax(double totalTax) { + Utils.checkNotNull(totalTax, "totalTax"); + this.totalTax = JsonNullable.of(totalTax); + return this; + } + + /** + * Total tax amount applied to this transaction. + */ + public Builder totalTax(JsonNullable totalTax) { + Utils.checkNotNull(totalTax, "totalTax"); + this.totalTax = totalTax; + return this; + } + + + /** + * Total amount of all expense lines including tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * Total amount of all expense lines including tax. + */ + public Builder totalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + + /** + * Total reimbursable amount (may differ from total if some expenses are non-reimbursable). + */ + public Builder reimbursableAmount(double reimbursableAmount) { + Utils.checkNotNull(reimbursableAmount, "reimbursableAmount"); + this.reimbursableAmount = JsonNullable.of(reimbursableAmount); + return this; + } + + /** + * Total reimbursable amount (may differ from total if some expenses are non-reimbursable). + */ + public Builder reimbursableAmount(JsonNullable reimbursableAmount) { + Utils.checkNotNull(reimbursableAmount, "reimbursableAmount"); + this.reimbursableAmount = reimbursableAmount; + return this; + } + + + /** + * The memo of the expense report. + */ + public Builder memo(String memo) { + Utils.checkNotNull(memo, "memo"); + this.memo = JsonNullable.of(memo); + return this; + } + + /** + * The memo of the expense report. + */ + public Builder memo(JsonNullable memo) { + Utils.checkNotNull(memo, "memo"); + this.memo = memo; + return this; + } + + + public Builder department(LinkedDepartment department) { + Utils.checkNotNull(department, "department"); + this.department = JsonNullable.of(department); + return this; + } + + public Builder department(JsonNullable department) { + Utils.checkNotNull(department, "department"); + this.department = department; + return this; + } + + + public Builder location(LinkedLocation location) { + Utils.checkNotNull(location, "location"); + this.location = JsonNullable.of(location); + return this; + } + + public Builder location(JsonNullable location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + + public Builder account(LinkedLedgerAccount account) { + Utils.checkNotNull(account, "account"); + this.account = JsonNullable.of(account); + return this; + } + + public Builder account(JsonNullable account) { + Utils.checkNotNull(account, "account"); + this.account = account; + return this; + } + + + /** + * The accounting period the expense report is posted to. + */ + public Builder accountingPeriod(AccountingPeriod accountingPeriod) { + Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + this.accountingPeriod = JsonNullable.of(accountingPeriod); + return this; + } + + /** + * The accounting period the expense report is posted to. + */ + public Builder accountingPeriod(JsonNullable accountingPeriod) { + Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + this.accountingPeriod = accountingPeriod; + return this; + } + + + /** + * Expense line items linked to this expense report. + */ + public Builder lineItems(List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + + public Builder subsidiary(LinkedSubsidiary subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = JsonNullable.of(subsidiary); + return this; + } + + public Builder subsidiary(JsonNullable subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = subsidiary; + return this; + } + + + /** + * A list of linked tracking categories. + */ + public Builder trackingCategories(List trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = JsonNullable.of(trackingCategories); + return this; + } + + /** + * A list of linked tracking categories. + */ + public Builder trackingCategories(JsonNullable> trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = trackingCategories; + return this; + } + + + /** + * Amounts are including tax + */ + public Builder taxInclusive(boolean taxInclusive) { + Utils.checkNotNull(taxInclusive, "taxInclusive"); + this.taxInclusive = JsonNullable.of(taxInclusive); + return this; + } + + /** + * Amounts are including tax + */ + public Builder taxInclusive(JsonNullable taxInclusive) { + Utils.checkNotNull(taxInclusive, "taxInclusive"); + this.taxInclusive = taxInclusive; + return this; + } + + + /** + * The person who approved the expense report. + */ + public Builder approvedBy(ApprovedBy approvedBy) { + Utils.checkNotNull(approvedBy, "approvedBy"); + this.approvedBy = JsonNullable.of(approvedBy); + return this; + } + + /** + * The person who approved the expense report. + */ + public Builder approvedBy(JsonNullable approvedBy) { + Utils.checkNotNull(approvedBy, "approvedBy"); + this.approvedBy = approvedBy; + return this; + } + + + public Builder customFields(List customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = Optional.ofNullable(customFields); + return this; + } + + public Builder customFields(Optional> customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = customFields; + return this; + } + + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + public Builder customMappings(Map customMappings) { + Utils.checkNotNull(customMappings, "customMappings"); + this.customMappings = JsonNullable.of(customMappings); + return this; + } + + /** + * When custom mappings are configured on the resource, the result is included here. + */ + public Builder customMappings(JsonNullable> customMappings) { + Utils.checkNotNull(customMappings, "customMappings"); + this.customMappings = customMappings; + return this; + } + + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public Builder rowVersion(String rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = JsonNullable.of(rowVersion); + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public Builder rowVersion(JsonNullable rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = rowVersion; + return this; + } + + + /** + * The date and time when the object was last updated. + */ + public Builder updatedAt(OffsetDateTime updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = JsonNullable.of(updatedAt); + return this; + } + + /** + * The date and time when the object was last updated. + */ + public Builder updatedAt(JsonNullable updatedAt) { + Utils.checkNotNull(updatedAt, "updatedAt"); + this.updatedAt = updatedAt; + return this; + } + + + /** + * The date and time when the object was created. + */ + public Builder createdAt(OffsetDateTime createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = JsonNullable.of(createdAt); + return this; + } + + /** + * The date and time when the object was created. + */ + public Builder createdAt(JsonNullable createdAt) { + Utils.checkNotNull(createdAt, "createdAt"); + this.createdAt = createdAt; + return this; + } + + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public Builder passThrough(List passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = Optional.ofNullable(passThrough); + return this; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public Builder passThrough(Optional> passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = passThrough; + return this; + } + + public ExpenseReport build() { + + return new ExpenseReport( + id, displayId, number, + title, employee, status, + transactionDate, postingDate, dueDate, + currency, currencyRate, subTotal, + totalTax, totalAmount, reimbursableAmount, + memo, department, location, + account, accountingPeriod, lineItems, + subsidiary, trackingCategories, taxInclusive, + approvedBy, customFields, customMappings, + rowVersion, updatedAt, createdAt, + passThrough); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseReportEmployee.java b/src/main/java/com/apideck/unify/models/components/ExpenseReportEmployee.java new file mode 100644 index 000000000..81b76dcf5 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ExpenseReportEmployee.java @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Override; +import java.lang.String; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * ExpenseReportEmployee + * + *

The employee who submitted the expense report. + */ +public class ExpenseReportEmployee { + /** + * A unique identifier for the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The display name of the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("display_name") + private JsonNullable displayName; + + @JsonCreator + public ExpenseReportEmployee( + @JsonProperty("id") Optional id, + @JsonProperty("display_name") JsonNullable displayName) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(displayName, "displayName"); + this.id = id; + this.displayName = displayName; + } + + public ExpenseReportEmployee() { + this(Optional.empty(), JsonNullable.undefined()); + } + + /** + * A unique identifier for the employee. + */ + @JsonIgnore + public Optional id() { + return id; + } + + /** + * The display name of the employee. + */ + @JsonIgnore + public JsonNullable displayName() { + return displayName; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * A unique identifier for the employee. + */ + public ExpenseReportEmployee withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + + /** + * A unique identifier for the employee. + */ + public ExpenseReportEmployee withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The display name of the employee. + */ + public ExpenseReportEmployee withDisplayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = JsonNullable.of(displayName); + return this; + } + + /** + * The display name of the employee. + */ + public ExpenseReportEmployee withDisplayName(JsonNullable displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExpenseReportEmployee other = (ExpenseReportEmployee) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.displayName, other.displayName); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, displayName); + } + + @Override + public String toString() { + return Utils.toString(ExpenseReportEmployee.class, + "id", id, + "displayName", displayName); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional id = Optional.empty(); + + private JsonNullable displayName = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * A unique identifier for the employee. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * A unique identifier for the employee. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * The display name of the employee. + */ + public Builder displayName(String displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = JsonNullable.of(displayName); + return this; + } + + /** + * The display name of the employee. + */ + public Builder displayName(JsonNullable displayName) { + Utils.checkNotNull(displayName, "displayName"); + this.displayName = displayName; + return this; + } + + public ExpenseReportEmployee build() { + + return new ExpenseReportEmployee( + id, displayName); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseReportInput.java b/src/main/java/com/apideck/unify/models/components/ExpenseReportInput.java new file mode 100644 index 000000000..d8144b0d3 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ExpenseReportInput.java @@ -0,0 +1,1603 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Boolean; +import java.lang.Double; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ExpenseReportInput { + /** + * Id to be displayed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("display_id") + private JsonNullable displayId; + + /** + * The expense report number. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("number") + private JsonNullable number; + + /** + * Title or purpose of the expense report. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("title") + private JsonNullable title; + + /** + * The employee who submitted the expense report. + */ + @JsonProperty("employee") + private ExpenseReportEmployee employee; + + /** + * The status of the expense report. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("status") + private JsonNullable status; + + /** + * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + */ + @JsonInclude(Include.ALWAYS) + @JsonProperty("transaction_date") + private Optional transactionDate; + + /** + * The date the expense report was posted to the general ledger. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("posting_date") + private JsonNullable postingDate; + + /** + * Date when reimbursement is due. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("due_date") + private JsonNullable dueDate; + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private JsonNullable currency; + + /** + * Currency Exchange Rate at the time entity was recorded/generated. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency_rate") + private JsonNullable currencyRate; + + /** + * Subtotal amount, normally before tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("sub_total") + private JsonNullable subTotal; + + /** + * Total tax amount applied to this transaction. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("total_tax") + private JsonNullable totalTax; + + /** + * Total amount of all expense lines including tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("total_amount") + private JsonNullable totalAmount; + + /** + * Total reimbursable amount (may differ from total if some expenses are non-reimbursable). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reimbursable_amount") + private JsonNullable reimbursableAmount; + + /** + * The memo of the expense report. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("memo") + private JsonNullable memo; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("department") + private JsonNullable department; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("location") + private JsonNullable location; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("account") + private JsonNullable account; + + /** + * The accounting period the expense report is posted to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("accounting_period") + private JsonNullable accountingPeriod; + + /** + * Expense line items linked to this expense report. + */ + @JsonProperty("line_items") + private List lineItems; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("subsidiary") + private JsonNullable subsidiary; + + /** + * A list of linked tracking categories. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tracking_categories") + private JsonNullable> trackingCategories; + + /** + * Amounts are including tax + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tax_inclusive") + private JsonNullable taxInclusive; + + /** + * The person who approved the expense report. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("approved_by") + private JsonNullable approvedBy; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("custom_fields") + private Optional> customFields; + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("row_version") + private JsonNullable rowVersion; + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("pass_through") + private Optional> passThrough; + + @JsonCreator + public ExpenseReportInput( + @JsonProperty("display_id") JsonNullable displayId, + @JsonProperty("number") JsonNullable number, + @JsonProperty("title") JsonNullable title, + @JsonProperty("employee") ExpenseReportEmployee employee, + @JsonProperty("status") JsonNullable status, + @JsonProperty("transaction_date") Optional transactionDate, + @JsonProperty("posting_date") JsonNullable postingDate, + @JsonProperty("due_date") JsonNullable dueDate, + @JsonProperty("currency") JsonNullable currency, + @JsonProperty("currency_rate") JsonNullable currencyRate, + @JsonProperty("sub_total") JsonNullable subTotal, + @JsonProperty("total_tax") JsonNullable totalTax, + @JsonProperty("total_amount") JsonNullable totalAmount, + @JsonProperty("reimbursable_amount") JsonNullable reimbursableAmount, + @JsonProperty("memo") JsonNullable memo, + @JsonProperty("department") JsonNullable department, + @JsonProperty("location") JsonNullable location, + @JsonProperty("account") JsonNullable account, + @JsonProperty("accounting_period") JsonNullable accountingPeriod, + @JsonProperty("line_items") List lineItems, + @JsonProperty("subsidiary") JsonNullable subsidiary, + @JsonProperty("tracking_categories") JsonNullable> trackingCategories, + @JsonProperty("tax_inclusive") JsonNullable taxInclusive, + @JsonProperty("approved_by") JsonNullable approvedBy, + @JsonProperty("custom_fields") Optional> customFields, + @JsonProperty("row_version") JsonNullable rowVersion, + @JsonProperty("pass_through") Optional> passThrough) { + Utils.checkNotNull(displayId, "displayId"); + Utils.checkNotNull(number, "number"); + Utils.checkNotNull(title, "title"); + Utils.checkNotNull(employee, "employee"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(transactionDate, "transactionDate"); + Utils.checkNotNull(postingDate, "postingDate"); + Utils.checkNotNull(dueDate, "dueDate"); + Utils.checkNotNull(currency, "currency"); + Utils.checkNotNull(currencyRate, "currencyRate"); + Utils.checkNotNull(subTotal, "subTotal"); + Utils.checkNotNull(totalTax, "totalTax"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(reimbursableAmount, "reimbursableAmount"); + Utils.checkNotNull(memo, "memo"); + Utils.checkNotNull(department, "department"); + Utils.checkNotNull(location, "location"); + Utils.checkNotNull(account, "account"); + Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + Utils.checkNotNull(lineItems, "lineItems"); + Utils.checkNotNull(subsidiary, "subsidiary"); + Utils.checkNotNull(trackingCategories, "trackingCategories"); + Utils.checkNotNull(taxInclusive, "taxInclusive"); + Utils.checkNotNull(approvedBy, "approvedBy"); + Utils.checkNotNull(customFields, "customFields"); + Utils.checkNotNull(rowVersion, "rowVersion"); + Utils.checkNotNull(passThrough, "passThrough"); + this.displayId = displayId; + this.number = number; + this.title = title; + this.employee = employee; + this.status = status; + this.transactionDate = transactionDate; + this.postingDate = postingDate; + this.dueDate = dueDate; + this.currency = currency; + this.currencyRate = currencyRate; + this.subTotal = subTotal; + this.totalTax = totalTax; + this.totalAmount = totalAmount; + this.reimbursableAmount = reimbursableAmount; + this.memo = memo; + this.department = department; + this.location = location; + this.account = account; + this.accountingPeriod = accountingPeriod; + this.lineItems = lineItems; + this.subsidiary = subsidiary; + this.trackingCategories = trackingCategories; + this.taxInclusive = taxInclusive; + this.approvedBy = approvedBy; + this.customFields = customFields; + this.rowVersion = rowVersion; + this.passThrough = passThrough; + } + + public ExpenseReportInput( + ExpenseReportEmployee employee, + List lineItems) { + this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + employee, JsonNullable.undefined(), Optional.empty(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), lineItems, JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + Optional.empty(), JsonNullable.undefined(), Optional.empty()); + } + + /** + * Id to be displayed. + */ + @JsonIgnore + public JsonNullable displayId() { + return displayId; + } + + /** + * The expense report number. + */ + @JsonIgnore + public JsonNullable number() { + return number; + } + + /** + * Title or purpose of the expense report. + */ + @JsonIgnore + public JsonNullable title() { + return title; + } + + /** + * The employee who submitted the expense report. + */ + @JsonIgnore + public ExpenseReportEmployee employee() { + return employee; + } + + /** + * The status of the expense report. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable status() { + return (JsonNullable) status; + } + + /** + * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + */ + @JsonIgnore + public Optional transactionDate() { + return transactionDate; + } + + /** + * The date the expense report was posted to the general ledger. + */ + @JsonIgnore + public JsonNullable postingDate() { + return postingDate; + } + + /** + * Date when reimbursement is due. + */ + @JsonIgnore + public JsonNullable dueDate() { + return dueDate; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable currency() { + return (JsonNullable) currency; + } + + /** + * Currency Exchange Rate at the time entity was recorded/generated. + */ + @JsonIgnore + public JsonNullable currencyRate() { + return currencyRate; + } + + /** + * Subtotal amount, normally before tax. + */ + @JsonIgnore + public JsonNullable subTotal() { + return subTotal; + } + + /** + * Total tax amount applied to this transaction. + */ + @JsonIgnore + public JsonNullable totalTax() { + return totalTax; + } + + /** + * Total amount of all expense lines including tax. + */ + @JsonIgnore + public JsonNullable totalAmount() { + return totalAmount; + } + + /** + * Total reimbursable amount (may differ from total if some expenses are non-reimbursable). + */ + @JsonIgnore + public JsonNullable reimbursableAmount() { + return reimbursableAmount; + } + + /** + * The memo of the expense report. + */ + @JsonIgnore + public JsonNullable memo() { + return memo; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable department() { + return (JsonNullable) department; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable location() { + return (JsonNullable) location; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable account() { + return (JsonNullable) account; + } + + /** + * The accounting period the expense report is posted to. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable accountingPeriod() { + return (JsonNullable) accountingPeriod; + } + + /** + * Expense line items linked to this expense report. + */ + @JsonIgnore + public List lineItems() { + return lineItems; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable subsidiary() { + return (JsonNullable) subsidiary; + } + + /** + * A list of linked tracking categories. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> trackingCategories() { + return (JsonNullable>) trackingCategories; + } + + /** + * Amounts are including tax + */ + @JsonIgnore + public JsonNullable taxInclusive() { + return taxInclusive; + } + + /** + * The person who approved the expense report. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable approvedBy() { + return (JsonNullable) approvedBy; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> customFields() { + return (Optional>) customFields; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + @JsonIgnore + public JsonNullable rowVersion() { + return rowVersion; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional> passThrough() { + return (Optional>) passThrough; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Id to be displayed. + */ + public ExpenseReportInput withDisplayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public ExpenseReportInput withDisplayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + /** + * The expense report number. + */ + public ExpenseReportInput withNumber(String number) { + Utils.checkNotNull(number, "number"); + this.number = JsonNullable.of(number); + return this; + } + + /** + * The expense report number. + */ + public ExpenseReportInput withNumber(JsonNullable number) { + Utils.checkNotNull(number, "number"); + this.number = number; + return this; + } + + /** + * Title or purpose of the expense report. + */ + public ExpenseReportInput withTitle(String title) { + Utils.checkNotNull(title, "title"); + this.title = JsonNullable.of(title); + return this; + } + + /** + * Title or purpose of the expense report. + */ + public ExpenseReportInput withTitle(JsonNullable title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + /** + * The employee who submitted the expense report. + */ + public ExpenseReportInput withEmployee(ExpenseReportEmployee employee) { + Utils.checkNotNull(employee, "employee"); + this.employee = employee; + return this; + } + + /** + * The status of the expense report. + */ + public ExpenseReportInput withStatus(ExpenseReportStatus status) { + Utils.checkNotNull(status, "status"); + this.status = JsonNullable.of(status); + return this; + } + + /** + * The status of the expense report. + */ + public ExpenseReportInput withStatus(JsonNullable status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + */ + public ExpenseReportInput withTransactionDate(OffsetDateTime transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + + /** + * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + */ + public ExpenseReportInput withTransactionDate(Optional transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = transactionDate; + return this; + } + + /** + * The date the expense report was posted to the general ledger. + */ + public ExpenseReportInput withPostingDate(LocalDate postingDate) { + Utils.checkNotNull(postingDate, "postingDate"); + this.postingDate = JsonNullable.of(postingDate); + return this; + } + + /** + * The date the expense report was posted to the general ledger. + */ + public ExpenseReportInput withPostingDate(JsonNullable postingDate) { + Utils.checkNotNull(postingDate, "postingDate"); + this.postingDate = postingDate; + return this; + } + + /** + * Date when reimbursement is due. + */ + public ExpenseReportInput withDueDate(LocalDate dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = JsonNullable.of(dueDate); + return this; + } + + /** + * Date when reimbursement is due. + */ + public ExpenseReportInput withDueDate(JsonNullable dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public ExpenseReportInput withCurrency(Currency currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public ExpenseReportInput withCurrency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + /** + * Currency Exchange Rate at the time entity was recorded/generated. + */ + public ExpenseReportInput withCurrencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Currency Exchange Rate at the time entity was recorded/generated. + */ + public ExpenseReportInput withCurrencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + /** + * Subtotal amount, normally before tax. + */ + public ExpenseReportInput withSubTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Subtotal amount, normally before tax. + */ + public ExpenseReportInput withSubTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + /** + * Total tax amount applied to this transaction. + */ + public ExpenseReportInput withTotalTax(double totalTax) { + Utils.checkNotNull(totalTax, "totalTax"); + this.totalTax = JsonNullable.of(totalTax); + return this; + } + + /** + * Total tax amount applied to this transaction. + */ + public ExpenseReportInput withTotalTax(JsonNullable totalTax) { + Utils.checkNotNull(totalTax, "totalTax"); + this.totalTax = totalTax; + return this; + } + + /** + * Total amount of all expense lines including tax. + */ + public ExpenseReportInput withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * Total amount of all expense lines including tax. + */ + public ExpenseReportInput withTotalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * Total reimbursable amount (may differ from total if some expenses are non-reimbursable). + */ + public ExpenseReportInput withReimbursableAmount(double reimbursableAmount) { + Utils.checkNotNull(reimbursableAmount, "reimbursableAmount"); + this.reimbursableAmount = JsonNullable.of(reimbursableAmount); + return this; + } + + /** + * Total reimbursable amount (may differ from total if some expenses are non-reimbursable). + */ + public ExpenseReportInput withReimbursableAmount(JsonNullable reimbursableAmount) { + Utils.checkNotNull(reimbursableAmount, "reimbursableAmount"); + this.reimbursableAmount = reimbursableAmount; + return this; + } + + /** + * The memo of the expense report. + */ + public ExpenseReportInput withMemo(String memo) { + Utils.checkNotNull(memo, "memo"); + this.memo = JsonNullable.of(memo); + return this; + } + + /** + * The memo of the expense report. + */ + public ExpenseReportInput withMemo(JsonNullable memo) { + Utils.checkNotNull(memo, "memo"); + this.memo = memo; + return this; + } + + public ExpenseReportInput withDepartment(LinkedDepartmentInput department) { + Utils.checkNotNull(department, "department"); + this.department = JsonNullable.of(department); + return this; + } + + public ExpenseReportInput withDepartment(JsonNullable department) { + Utils.checkNotNull(department, "department"); + this.department = department; + return this; + } + + public ExpenseReportInput withLocation(LinkedLocationInput location) { + Utils.checkNotNull(location, "location"); + this.location = JsonNullable.of(location); + return this; + } + + public ExpenseReportInput withLocation(JsonNullable location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + public ExpenseReportInput withAccount(LinkedLedgerAccount account) { + Utils.checkNotNull(account, "account"); + this.account = JsonNullable.of(account); + return this; + } + + public ExpenseReportInput withAccount(JsonNullable account) { + Utils.checkNotNull(account, "account"); + this.account = account; + return this; + } + + /** + * The accounting period the expense report is posted to. + */ + public ExpenseReportInput withAccountingPeriod(AccountingPeriod accountingPeriod) { + Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + this.accountingPeriod = JsonNullable.of(accountingPeriod); + return this; + } + + /** + * The accounting period the expense report is posted to. + */ + public ExpenseReportInput withAccountingPeriod(JsonNullable accountingPeriod) { + Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + this.accountingPeriod = accountingPeriod; + return this; + } + + /** + * Expense line items linked to this expense report. + */ + public ExpenseReportInput withLineItems(List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + public ExpenseReportInput withSubsidiary(LinkedSubsidiaryInput subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = JsonNullable.of(subsidiary); + return this; + } + + public ExpenseReportInput withSubsidiary(JsonNullable subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = subsidiary; + return this; + } + + /** + * A list of linked tracking categories. + */ + public ExpenseReportInput withTrackingCategories(List trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = JsonNullable.of(trackingCategories); + return this; + } + + /** + * A list of linked tracking categories. + */ + public ExpenseReportInput withTrackingCategories(JsonNullable> trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = trackingCategories; + return this; + } + + /** + * Amounts are including tax + */ + public ExpenseReportInput withTaxInclusive(boolean taxInclusive) { + Utils.checkNotNull(taxInclusive, "taxInclusive"); + this.taxInclusive = JsonNullable.of(taxInclusive); + return this; + } + + /** + * Amounts are including tax + */ + public ExpenseReportInput withTaxInclusive(JsonNullable taxInclusive) { + Utils.checkNotNull(taxInclusive, "taxInclusive"); + this.taxInclusive = taxInclusive; + return this; + } + + /** + * The person who approved the expense report. + */ + public ExpenseReportInput withApprovedBy(ApprovedBy approvedBy) { + Utils.checkNotNull(approvedBy, "approvedBy"); + this.approvedBy = JsonNullable.of(approvedBy); + return this; + } + + /** + * The person who approved the expense report. + */ + public ExpenseReportInput withApprovedBy(JsonNullable approvedBy) { + Utils.checkNotNull(approvedBy, "approvedBy"); + this.approvedBy = approvedBy; + return this; + } + + public ExpenseReportInput withCustomFields(List customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = Optional.ofNullable(customFields); + return this; + } + + + public ExpenseReportInput withCustomFields(Optional> customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = customFields; + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public ExpenseReportInput withRowVersion(String rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = JsonNullable.of(rowVersion); + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public ExpenseReportInput withRowVersion(JsonNullable rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = rowVersion; + return this; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public ExpenseReportInput withPassThrough(List passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = Optional.ofNullable(passThrough); + return this; + } + + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public ExpenseReportInput withPassThrough(Optional> passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = passThrough; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExpenseReportInput other = (ExpenseReportInput) o; + return + Utils.enhancedDeepEquals(this.displayId, other.displayId) && + Utils.enhancedDeepEquals(this.number, other.number) && + Utils.enhancedDeepEquals(this.title, other.title) && + Utils.enhancedDeepEquals(this.employee, other.employee) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.transactionDate, other.transactionDate) && + Utils.enhancedDeepEquals(this.postingDate, other.postingDate) && + Utils.enhancedDeepEquals(this.dueDate, other.dueDate) && + Utils.enhancedDeepEquals(this.currency, other.currency) && + Utils.enhancedDeepEquals(this.currencyRate, other.currencyRate) && + Utils.enhancedDeepEquals(this.subTotal, other.subTotal) && + Utils.enhancedDeepEquals(this.totalTax, other.totalTax) && + Utils.enhancedDeepEquals(this.totalAmount, other.totalAmount) && + Utils.enhancedDeepEquals(this.reimbursableAmount, other.reimbursableAmount) && + Utils.enhancedDeepEquals(this.memo, other.memo) && + Utils.enhancedDeepEquals(this.department, other.department) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.account, other.account) && + Utils.enhancedDeepEquals(this.accountingPeriod, other.accountingPeriod) && + Utils.enhancedDeepEquals(this.lineItems, other.lineItems) && + Utils.enhancedDeepEquals(this.subsidiary, other.subsidiary) && + Utils.enhancedDeepEquals(this.trackingCategories, other.trackingCategories) && + Utils.enhancedDeepEquals(this.taxInclusive, other.taxInclusive) && + Utils.enhancedDeepEquals(this.approvedBy, other.approvedBy) && + Utils.enhancedDeepEquals(this.customFields, other.customFields) && + Utils.enhancedDeepEquals(this.rowVersion, other.rowVersion) && + Utils.enhancedDeepEquals(this.passThrough, other.passThrough); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + displayId, number, title, + employee, status, transactionDate, + postingDate, dueDate, currency, + currencyRate, subTotal, totalTax, + totalAmount, reimbursableAmount, memo, + department, location, account, + accountingPeriod, lineItems, subsidiary, + trackingCategories, taxInclusive, approvedBy, + customFields, rowVersion, passThrough); + } + + @Override + public String toString() { + return Utils.toString(ExpenseReportInput.class, + "displayId", displayId, + "number", number, + "title", title, + "employee", employee, + "status", status, + "transactionDate", transactionDate, + "postingDate", postingDate, + "dueDate", dueDate, + "currency", currency, + "currencyRate", currencyRate, + "subTotal", subTotal, + "totalTax", totalTax, + "totalAmount", totalAmount, + "reimbursableAmount", reimbursableAmount, + "memo", memo, + "department", department, + "location", location, + "account", account, + "accountingPeriod", accountingPeriod, + "lineItems", lineItems, + "subsidiary", subsidiary, + "trackingCategories", trackingCategories, + "taxInclusive", taxInclusive, + "approvedBy", approvedBy, + "customFields", customFields, + "rowVersion", rowVersion, + "passThrough", passThrough); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private JsonNullable displayId = JsonNullable.undefined(); + + private JsonNullable number = JsonNullable.undefined(); + + private JsonNullable title = JsonNullable.undefined(); + + private ExpenseReportEmployee employee; + + private JsonNullable status = JsonNullable.undefined(); + + private Optional transactionDate = Optional.empty(); + + private JsonNullable postingDate = JsonNullable.undefined(); + + private JsonNullable dueDate = JsonNullable.undefined(); + + private JsonNullable currency = JsonNullable.undefined(); + + private JsonNullable currencyRate = JsonNullable.undefined(); + + private JsonNullable subTotal = JsonNullable.undefined(); + + private JsonNullable totalTax = JsonNullable.undefined(); + + private JsonNullable totalAmount = JsonNullable.undefined(); + + private JsonNullable reimbursableAmount = JsonNullable.undefined(); + + private JsonNullable memo = JsonNullable.undefined(); + + private JsonNullable department = JsonNullable.undefined(); + + private JsonNullable location = JsonNullable.undefined(); + + private JsonNullable account = JsonNullable.undefined(); + + private JsonNullable accountingPeriod = JsonNullable.undefined(); + + private List lineItems; + + private JsonNullable subsidiary = JsonNullable.undefined(); + + private JsonNullable> trackingCategories = JsonNullable.undefined(); + + private JsonNullable taxInclusive = JsonNullable.undefined(); + + private JsonNullable approvedBy = JsonNullable.undefined(); + + private Optional> customFields = Optional.empty(); + + private JsonNullable rowVersion = JsonNullable.undefined(); + + private Optional> passThrough = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * Id to be displayed. + */ + public Builder displayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public Builder displayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + + /** + * The expense report number. + */ + public Builder number(String number) { + Utils.checkNotNull(number, "number"); + this.number = JsonNullable.of(number); + return this; + } + + /** + * The expense report number. + */ + public Builder number(JsonNullable number) { + Utils.checkNotNull(number, "number"); + this.number = number; + return this; + } + + + /** + * Title or purpose of the expense report. + */ + public Builder title(String title) { + Utils.checkNotNull(title, "title"); + this.title = JsonNullable.of(title); + return this; + } + + /** + * Title or purpose of the expense report. + */ + public Builder title(JsonNullable title) { + Utils.checkNotNull(title, "title"); + this.title = title; + return this; + } + + + /** + * The employee who submitted the expense report. + */ + public Builder employee(ExpenseReportEmployee employee) { + Utils.checkNotNull(employee, "employee"); + this.employee = employee; + return this; + } + + + /** + * The status of the expense report. + */ + public Builder status(ExpenseReportStatus status) { + Utils.checkNotNull(status, "status"); + this.status = JsonNullable.of(status); + return this; + } + + /** + * The status of the expense report. + */ + public Builder status(JsonNullable status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + */ + public Builder transactionDate(OffsetDateTime transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + /** + * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD + */ + public Builder transactionDate(Optional transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = transactionDate; + return this; + } + + + /** + * The date the expense report was posted to the general ledger. + */ + public Builder postingDate(LocalDate postingDate) { + Utils.checkNotNull(postingDate, "postingDate"); + this.postingDate = JsonNullable.of(postingDate); + return this; + } + + /** + * The date the expense report was posted to the general ledger. + */ + public Builder postingDate(JsonNullable postingDate) { + Utils.checkNotNull(postingDate, "postingDate"); + this.postingDate = postingDate; + return this; + } + + + /** + * Date when reimbursement is due. + */ + public Builder dueDate(LocalDate dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = JsonNullable.of(dueDate); + return this; + } + + /** + * Date when reimbursement is due. + */ + public Builder dueDate(JsonNullable dueDate) { + Utils.checkNotNull(dueDate, "dueDate"); + this.dueDate = dueDate; + return this; + } + + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public Builder currency(Currency currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public Builder currency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + + /** + * Currency Exchange Rate at the time entity was recorded/generated. + */ + public Builder currencyRate(double currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = JsonNullable.of(currencyRate); + return this; + } + + /** + * Currency Exchange Rate at the time entity was recorded/generated. + */ + public Builder currencyRate(JsonNullable currencyRate) { + Utils.checkNotNull(currencyRate, "currencyRate"); + this.currencyRate = currencyRate; + return this; + } + + + /** + * Subtotal amount, normally before tax. + */ + public Builder subTotal(double subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = JsonNullable.of(subTotal); + return this; + } + + /** + * Subtotal amount, normally before tax. + */ + public Builder subTotal(JsonNullable subTotal) { + Utils.checkNotNull(subTotal, "subTotal"); + this.subTotal = subTotal; + return this; + } + + + /** + * Total tax amount applied to this transaction. + */ + public Builder totalTax(double totalTax) { + Utils.checkNotNull(totalTax, "totalTax"); + this.totalTax = JsonNullable.of(totalTax); + return this; + } + + /** + * Total tax amount applied to this transaction. + */ + public Builder totalTax(JsonNullable totalTax) { + Utils.checkNotNull(totalTax, "totalTax"); + this.totalTax = totalTax; + return this; + } + + + /** + * Total amount of all expense lines including tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * Total amount of all expense lines including tax. + */ + public Builder totalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + + /** + * Total reimbursable amount (may differ from total if some expenses are non-reimbursable). + */ + public Builder reimbursableAmount(double reimbursableAmount) { + Utils.checkNotNull(reimbursableAmount, "reimbursableAmount"); + this.reimbursableAmount = JsonNullable.of(reimbursableAmount); + return this; + } + + /** + * Total reimbursable amount (may differ from total if some expenses are non-reimbursable). + */ + public Builder reimbursableAmount(JsonNullable reimbursableAmount) { + Utils.checkNotNull(reimbursableAmount, "reimbursableAmount"); + this.reimbursableAmount = reimbursableAmount; + return this; + } + + + /** + * The memo of the expense report. + */ + public Builder memo(String memo) { + Utils.checkNotNull(memo, "memo"); + this.memo = JsonNullable.of(memo); + return this; + } + + /** + * The memo of the expense report. + */ + public Builder memo(JsonNullable memo) { + Utils.checkNotNull(memo, "memo"); + this.memo = memo; + return this; + } + + + public Builder department(LinkedDepartmentInput department) { + Utils.checkNotNull(department, "department"); + this.department = JsonNullable.of(department); + return this; + } + + public Builder department(JsonNullable department) { + Utils.checkNotNull(department, "department"); + this.department = department; + return this; + } + + + public Builder location(LinkedLocationInput location) { + Utils.checkNotNull(location, "location"); + this.location = JsonNullable.of(location); + return this; + } + + public Builder location(JsonNullable location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + + public Builder account(LinkedLedgerAccount account) { + Utils.checkNotNull(account, "account"); + this.account = JsonNullable.of(account); + return this; + } + + public Builder account(JsonNullable account) { + Utils.checkNotNull(account, "account"); + this.account = account; + return this; + } + + + /** + * The accounting period the expense report is posted to. + */ + public Builder accountingPeriod(AccountingPeriod accountingPeriod) { + Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + this.accountingPeriod = JsonNullable.of(accountingPeriod); + return this; + } + + /** + * The accounting period the expense report is posted to. + */ + public Builder accountingPeriod(JsonNullable accountingPeriod) { + Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + this.accountingPeriod = accountingPeriod; + return this; + } + + + /** + * Expense line items linked to this expense report. + */ + public Builder lineItems(List lineItems) { + Utils.checkNotNull(lineItems, "lineItems"); + this.lineItems = lineItems; + return this; + } + + + public Builder subsidiary(LinkedSubsidiaryInput subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = JsonNullable.of(subsidiary); + return this; + } + + public Builder subsidiary(JsonNullable subsidiary) { + Utils.checkNotNull(subsidiary, "subsidiary"); + this.subsidiary = subsidiary; + return this; + } + + + /** + * A list of linked tracking categories. + */ + public Builder trackingCategories(List trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = JsonNullable.of(trackingCategories); + return this; + } + + /** + * A list of linked tracking categories. + */ + public Builder trackingCategories(JsonNullable> trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = trackingCategories; + return this; + } + + + /** + * Amounts are including tax + */ + public Builder taxInclusive(boolean taxInclusive) { + Utils.checkNotNull(taxInclusive, "taxInclusive"); + this.taxInclusive = JsonNullable.of(taxInclusive); + return this; + } + + /** + * Amounts are including tax + */ + public Builder taxInclusive(JsonNullable taxInclusive) { + Utils.checkNotNull(taxInclusive, "taxInclusive"); + this.taxInclusive = taxInclusive; + return this; + } + + + /** + * The person who approved the expense report. + */ + public Builder approvedBy(ApprovedBy approvedBy) { + Utils.checkNotNull(approvedBy, "approvedBy"); + this.approvedBy = JsonNullable.of(approvedBy); + return this; + } + + /** + * The person who approved the expense report. + */ + public Builder approvedBy(JsonNullable approvedBy) { + Utils.checkNotNull(approvedBy, "approvedBy"); + this.approvedBy = approvedBy; + return this; + } + + + public Builder customFields(List customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = Optional.ofNullable(customFields); + return this; + } + + public Builder customFields(Optional> customFields) { + Utils.checkNotNull(customFields, "customFields"); + this.customFields = customFields; + return this; + } + + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public Builder rowVersion(String rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = JsonNullable.of(rowVersion); + return this; + } + + /** + * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each + * time an update is made to the object. + */ + public Builder rowVersion(JsonNullable rowVersion) { + Utils.checkNotNull(rowVersion, "rowVersion"); + this.rowVersion = rowVersion; + return this; + } + + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public Builder passThrough(List passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = Optional.ofNullable(passThrough); + return this; + } + + /** + * The pass_through property allows passing service-specific, custom data or structured modifications + * in request body when creating or updating resources. + */ + public Builder passThrough(Optional> passThrough) { + Utils.checkNotNull(passThrough, "passThrough"); + this.passThrough = passThrough; + return this; + } + + public ExpenseReportInput build() { + + return new ExpenseReportInput( + displayId, number, title, + employee, status, transactionDate, + postingDate, dueDate, currency, + currencyRate, subTotal, totalTax, + totalAmount, reimbursableAmount, memo, + department, location, account, + accountingPeriod, lineItems, subsidiary, + trackingCategories, taxInclusive, approvedBy, + customFields, rowVersion, passThrough); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseReportLineItem.java b/src/main/java/com/apideck/unify/models/components/ExpenseReportLineItem.java new file mode 100644 index 000000000..1647676b7 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ExpenseReportLineItem.java @@ -0,0 +1,1110 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Boolean; +import java.lang.Double; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.LocalDate; +import java.util.List; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ExpenseReportLineItem { + /** + * A unique identifier for an object. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The expense category for this line item. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expense_category") + private Optional expenseCategory; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("account") + private JsonNullable account; + + /** + * The description of the expense line item. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("quantity") + private JsonNullable quantity; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("unit_price") + private JsonNullable unitPrice; + + /** + * The amount of the expense line item. + */ + @JsonProperty("amount") + private double amount; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tax_rate") + private Optional taxRate; + + /** + * Tax amount + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tax_amount") + private JsonNullable taxAmount; + + /** + * The total amount of the expense line item including tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("total_amount") + private JsonNullable totalAmount; + + /** + * The date of the individual expense. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("transaction_date") + private JsonNullable transactionDate; + + /** + * Whether the expense is billable to a customer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("billable") + private JsonNullable billable; + + /** + * Whether the expense is reimbursable to the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reimbursable") + private JsonNullable reimbursable; + + /** + * The customer this entity is linked to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customer") + private JsonNullable customer; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("department") + private JsonNullable department; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("location") + private JsonNullable location; + + /** + * A list of linked tracking categories. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tracking_categories") + private JsonNullable> trackingCategories; + + /** + * URL to the receipt or attachment for this expense line. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("receipt_url") + private JsonNullable receiptUrl; + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private JsonNullable currency; + + @JsonCreator + public ExpenseReportLineItem( + @JsonProperty("id") Optional id, + @JsonProperty("expense_category") Optional expenseCategory, + @JsonProperty("account") JsonNullable account, + @JsonProperty("description") JsonNullable description, + @JsonProperty("quantity") JsonNullable quantity, + @JsonProperty("unit_price") JsonNullable unitPrice, + @JsonProperty("amount") double amount, + @JsonProperty("tax_rate") Optional taxRate, + @JsonProperty("tax_amount") JsonNullable taxAmount, + @JsonProperty("total_amount") JsonNullable totalAmount, + @JsonProperty("transaction_date") JsonNullable transactionDate, + @JsonProperty("billable") JsonNullable billable, + @JsonProperty("reimbursable") JsonNullable reimbursable, + @JsonProperty("customer") JsonNullable customer, + @JsonProperty("department") JsonNullable department, + @JsonProperty("location") JsonNullable location, + @JsonProperty("tracking_categories") JsonNullable> trackingCategories, + @JsonProperty("receipt_url") JsonNullable receiptUrl, + @JsonProperty("currency") JsonNullable currency) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(expenseCategory, "expenseCategory"); + Utils.checkNotNull(account, "account"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(quantity, "quantity"); + Utils.checkNotNull(unitPrice, "unitPrice"); + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(taxRate, "taxRate"); + Utils.checkNotNull(taxAmount, "taxAmount"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(transactionDate, "transactionDate"); + Utils.checkNotNull(billable, "billable"); + Utils.checkNotNull(reimbursable, "reimbursable"); + Utils.checkNotNull(customer, "customer"); + Utils.checkNotNull(department, "department"); + Utils.checkNotNull(location, "location"); + Utils.checkNotNull(trackingCategories, "trackingCategories"); + Utils.checkNotNull(receiptUrl, "receiptUrl"); + Utils.checkNotNull(currency, "currency"); + this.id = id; + this.expenseCategory = expenseCategory; + this.account = account; + this.description = description; + this.quantity = quantity; + this.unitPrice = unitPrice; + this.amount = amount; + this.taxRate = taxRate; + this.taxAmount = taxAmount; + this.totalAmount = totalAmount; + this.transactionDate = transactionDate; + this.billable = billable; + this.reimbursable = reimbursable; + this.customer = customer; + this.department = department; + this.location = location; + this.trackingCategories = trackingCategories; + this.receiptUrl = receiptUrl; + this.currency = currency; + } + + public ExpenseReportLineItem( + double amount) { + this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + amount, Optional.empty(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined()); + } + + /** + * A unique identifier for an object. + */ + @JsonIgnore + public Optional id() { + return id; + } + + /** + * The expense category for this line item. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional expenseCategory() { + return (Optional) expenseCategory; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable account() { + return (JsonNullable) account; + } + + /** + * The description of the expense line item. + */ + @JsonIgnore + public JsonNullable description() { + return description; + } + + @JsonIgnore + public JsonNullable quantity() { + return quantity; + } + + @JsonIgnore + public JsonNullable unitPrice() { + return unitPrice; + } + + /** + * The amount of the expense line item. + */ + @JsonIgnore + public double amount() { + return amount; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional taxRate() { + return (Optional) taxRate; + } + + /** + * Tax amount + */ + @JsonIgnore + public JsonNullable taxAmount() { + return taxAmount; + } + + /** + * The total amount of the expense line item including tax. + */ + @JsonIgnore + public JsonNullable totalAmount() { + return totalAmount; + } + + /** + * The date of the individual expense. + */ + @JsonIgnore + public JsonNullable transactionDate() { + return transactionDate; + } + + /** + * Whether the expense is billable to a customer. + */ + @JsonIgnore + public JsonNullable billable() { + return billable; + } + + /** + * Whether the expense is reimbursable to the employee. + */ + @JsonIgnore + public JsonNullable reimbursable() { + return reimbursable; + } + + /** + * The customer this entity is linked to. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable customer() { + return (JsonNullable) customer; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable department() { + return (JsonNullable) department; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable location() { + return (JsonNullable) location; + } + + /** + * A list of linked tracking categories. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> trackingCategories() { + return (JsonNullable>) trackingCategories; + } + + /** + * URL to the receipt or attachment for this expense line. + */ + @JsonIgnore + public JsonNullable receiptUrl() { + return receiptUrl; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable currency() { + return (JsonNullable) currency; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * A unique identifier for an object. + */ + public ExpenseReportLineItem withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + + /** + * A unique identifier for an object. + */ + public ExpenseReportLineItem withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The expense category for this line item. + */ + public ExpenseReportLineItem withExpenseCategory(ExpenseReportLineItemExpenseCategory expenseCategory) { + Utils.checkNotNull(expenseCategory, "expenseCategory"); + this.expenseCategory = Optional.ofNullable(expenseCategory); + return this; + } + + + /** + * The expense category for this line item. + */ + public ExpenseReportLineItem withExpenseCategory(Optional expenseCategory) { + Utils.checkNotNull(expenseCategory, "expenseCategory"); + this.expenseCategory = expenseCategory; + return this; + } + + public ExpenseReportLineItem withAccount(LinkedLedgerAccount account) { + Utils.checkNotNull(account, "account"); + this.account = JsonNullable.of(account); + return this; + } + + public ExpenseReportLineItem withAccount(JsonNullable account) { + Utils.checkNotNull(account, "account"); + this.account = account; + return this; + } + + /** + * The description of the expense line item. + */ + public ExpenseReportLineItem withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * The description of the expense line item. + */ + public ExpenseReportLineItem withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + public ExpenseReportLineItem withQuantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = JsonNullable.of(quantity); + return this; + } + + public ExpenseReportLineItem withQuantity(JsonNullable quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + public ExpenseReportLineItem withUnitPrice(double unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = JsonNullable.of(unitPrice); + return this; + } + + public ExpenseReportLineItem withUnitPrice(JsonNullable unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = unitPrice; + return this; + } + + /** + * The amount of the expense line item. + */ + public ExpenseReportLineItem withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + public ExpenseReportLineItem withTaxRate(LinkedTaxRate taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + + public ExpenseReportLineItem withTaxRate(Optional taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = taxRate; + return this; + } + + /** + * Tax amount + */ + public ExpenseReportLineItem withTaxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * Tax amount + */ + public ExpenseReportLineItem withTaxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * The total amount of the expense line item including tax. + */ + public ExpenseReportLineItem withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * The total amount of the expense line item including tax. + */ + public ExpenseReportLineItem withTotalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * The date of the individual expense. + */ + public ExpenseReportLineItem withTransactionDate(LocalDate transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = JsonNullable.of(transactionDate); + return this; + } + + /** + * The date of the individual expense. + */ + public ExpenseReportLineItem withTransactionDate(JsonNullable transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = transactionDate; + return this; + } + + /** + * Whether the expense is billable to a customer. + */ + public ExpenseReportLineItem withBillable(boolean billable) { + Utils.checkNotNull(billable, "billable"); + this.billable = JsonNullable.of(billable); + return this; + } + + /** + * Whether the expense is billable to a customer. + */ + public ExpenseReportLineItem withBillable(JsonNullable billable) { + Utils.checkNotNull(billable, "billable"); + this.billable = billable; + return this; + } + + /** + * Whether the expense is reimbursable to the employee. + */ + public ExpenseReportLineItem withReimbursable(boolean reimbursable) { + Utils.checkNotNull(reimbursable, "reimbursable"); + this.reimbursable = JsonNullable.of(reimbursable); + return this; + } + + /** + * Whether the expense is reimbursable to the employee. + */ + public ExpenseReportLineItem withReimbursable(JsonNullable reimbursable) { + Utils.checkNotNull(reimbursable, "reimbursable"); + this.reimbursable = reimbursable; + return this; + } + + /** + * The customer this entity is linked to. + */ + public ExpenseReportLineItem withCustomer(LinkedCustomer customer) { + Utils.checkNotNull(customer, "customer"); + this.customer = JsonNullable.of(customer); + return this; + } + + /** + * The customer this entity is linked to. + */ + public ExpenseReportLineItem withCustomer(JsonNullable customer) { + Utils.checkNotNull(customer, "customer"); + this.customer = customer; + return this; + } + + public ExpenseReportLineItem withDepartment(LinkedDepartment department) { + Utils.checkNotNull(department, "department"); + this.department = JsonNullable.of(department); + return this; + } + + public ExpenseReportLineItem withDepartment(JsonNullable department) { + Utils.checkNotNull(department, "department"); + this.department = department; + return this; + } + + public ExpenseReportLineItem withLocation(LinkedLocation location) { + Utils.checkNotNull(location, "location"); + this.location = JsonNullable.of(location); + return this; + } + + public ExpenseReportLineItem withLocation(JsonNullable location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + /** + * A list of linked tracking categories. + */ + public ExpenseReportLineItem withTrackingCategories(List trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = JsonNullable.of(trackingCategories); + return this; + } + + /** + * A list of linked tracking categories. + */ + public ExpenseReportLineItem withTrackingCategories(JsonNullable> trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = trackingCategories; + return this; + } + + /** + * URL to the receipt or attachment for this expense line. + */ + public ExpenseReportLineItem withReceiptUrl(String receiptUrl) { + Utils.checkNotNull(receiptUrl, "receiptUrl"); + this.receiptUrl = JsonNullable.of(receiptUrl); + return this; + } + + /** + * URL to the receipt or attachment for this expense line. + */ + public ExpenseReportLineItem withReceiptUrl(JsonNullable receiptUrl) { + Utils.checkNotNull(receiptUrl, "receiptUrl"); + this.receiptUrl = receiptUrl; + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public ExpenseReportLineItem withCurrency(Currency currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public ExpenseReportLineItem withCurrency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExpenseReportLineItem other = (ExpenseReportLineItem) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.expenseCategory, other.expenseCategory) && + Utils.enhancedDeepEquals(this.account, other.account) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.quantity, other.quantity) && + Utils.enhancedDeepEquals(this.unitPrice, other.unitPrice) && + Utils.enhancedDeepEquals(this.amount, other.amount) && + Utils.enhancedDeepEquals(this.taxRate, other.taxRate) && + Utils.enhancedDeepEquals(this.taxAmount, other.taxAmount) && + Utils.enhancedDeepEquals(this.totalAmount, other.totalAmount) && + Utils.enhancedDeepEquals(this.transactionDate, other.transactionDate) && + Utils.enhancedDeepEquals(this.billable, other.billable) && + Utils.enhancedDeepEquals(this.reimbursable, other.reimbursable) && + Utils.enhancedDeepEquals(this.customer, other.customer) && + Utils.enhancedDeepEquals(this.department, other.department) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.trackingCategories, other.trackingCategories) && + Utils.enhancedDeepEquals(this.receiptUrl, other.receiptUrl) && + Utils.enhancedDeepEquals(this.currency, other.currency); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, expenseCategory, account, + description, quantity, unitPrice, + amount, taxRate, taxAmount, + totalAmount, transactionDate, billable, + reimbursable, customer, department, + location, trackingCategories, receiptUrl, + currency); + } + + @Override + public String toString() { + return Utils.toString(ExpenseReportLineItem.class, + "id", id, + "expenseCategory", expenseCategory, + "account", account, + "description", description, + "quantity", quantity, + "unitPrice", unitPrice, + "amount", amount, + "taxRate", taxRate, + "taxAmount", taxAmount, + "totalAmount", totalAmount, + "transactionDate", transactionDate, + "billable", billable, + "reimbursable", reimbursable, + "customer", customer, + "department", department, + "location", location, + "trackingCategories", trackingCategories, + "receiptUrl", receiptUrl, + "currency", currency); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional id = Optional.empty(); + + private Optional expenseCategory = Optional.empty(); + + private JsonNullable account = JsonNullable.undefined(); + + private JsonNullable description = JsonNullable.undefined(); + + private JsonNullable quantity = JsonNullable.undefined(); + + private JsonNullable unitPrice = JsonNullable.undefined(); + + private Double amount; + + private Optional taxRate = Optional.empty(); + + private JsonNullable taxAmount = JsonNullable.undefined(); + + private JsonNullable totalAmount = JsonNullable.undefined(); + + private JsonNullable transactionDate = JsonNullable.undefined(); + + private JsonNullable billable = JsonNullable.undefined(); + + private JsonNullable reimbursable = JsonNullable.undefined(); + + private JsonNullable customer = JsonNullable.undefined(); + + private JsonNullable department = JsonNullable.undefined(); + + private JsonNullable location = JsonNullable.undefined(); + + private JsonNullable> trackingCategories = JsonNullable.undefined(); + + private JsonNullable receiptUrl = JsonNullable.undefined(); + + private JsonNullable currency = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * A unique identifier for an object. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * A unique identifier for an object. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * The expense category for this line item. + */ + public Builder expenseCategory(ExpenseReportLineItemExpenseCategory expenseCategory) { + Utils.checkNotNull(expenseCategory, "expenseCategory"); + this.expenseCategory = Optional.ofNullable(expenseCategory); + return this; + } + + /** + * The expense category for this line item. + */ + public Builder expenseCategory(Optional expenseCategory) { + Utils.checkNotNull(expenseCategory, "expenseCategory"); + this.expenseCategory = expenseCategory; + return this; + } + + + public Builder account(LinkedLedgerAccount account) { + Utils.checkNotNull(account, "account"); + this.account = JsonNullable.of(account); + return this; + } + + public Builder account(JsonNullable account) { + Utils.checkNotNull(account, "account"); + this.account = account; + return this; + } + + + /** + * The description of the expense line item. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * The description of the expense line item. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + + public Builder quantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = JsonNullable.of(quantity); + return this; + } + + public Builder quantity(JsonNullable quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + + public Builder unitPrice(double unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = JsonNullable.of(unitPrice); + return this; + } + + public Builder unitPrice(JsonNullable unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = unitPrice; + return this; + } + + + /** + * The amount of the expense line item. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + + public Builder taxRate(LinkedTaxRate taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + public Builder taxRate(Optional taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = taxRate; + return this; + } + + + /** + * Tax amount + */ + public Builder taxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * Tax amount + */ + public Builder taxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + + /** + * The total amount of the expense line item including tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * The total amount of the expense line item including tax. + */ + public Builder totalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + + /** + * The date of the individual expense. + */ + public Builder transactionDate(LocalDate transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = JsonNullable.of(transactionDate); + return this; + } + + /** + * The date of the individual expense. + */ + public Builder transactionDate(JsonNullable transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = transactionDate; + return this; + } + + + /** + * Whether the expense is billable to a customer. + */ + public Builder billable(boolean billable) { + Utils.checkNotNull(billable, "billable"); + this.billable = JsonNullable.of(billable); + return this; + } + + /** + * Whether the expense is billable to a customer. + */ + public Builder billable(JsonNullable billable) { + Utils.checkNotNull(billable, "billable"); + this.billable = billable; + return this; + } + + + /** + * Whether the expense is reimbursable to the employee. + */ + public Builder reimbursable(boolean reimbursable) { + Utils.checkNotNull(reimbursable, "reimbursable"); + this.reimbursable = JsonNullable.of(reimbursable); + return this; + } + + /** + * Whether the expense is reimbursable to the employee. + */ + public Builder reimbursable(JsonNullable reimbursable) { + Utils.checkNotNull(reimbursable, "reimbursable"); + this.reimbursable = reimbursable; + return this; + } + + + /** + * The customer this entity is linked to. + */ + public Builder customer(LinkedCustomer customer) { + Utils.checkNotNull(customer, "customer"); + this.customer = JsonNullable.of(customer); + return this; + } + + /** + * The customer this entity is linked to. + */ + public Builder customer(JsonNullable customer) { + Utils.checkNotNull(customer, "customer"); + this.customer = customer; + return this; + } + + + public Builder department(LinkedDepartment department) { + Utils.checkNotNull(department, "department"); + this.department = JsonNullable.of(department); + return this; + } + + public Builder department(JsonNullable department) { + Utils.checkNotNull(department, "department"); + this.department = department; + return this; + } + + + public Builder location(LinkedLocation location) { + Utils.checkNotNull(location, "location"); + this.location = JsonNullable.of(location); + return this; + } + + public Builder location(JsonNullable location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + + /** + * A list of linked tracking categories. + */ + public Builder trackingCategories(List trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = JsonNullable.of(trackingCategories); + return this; + } + + /** + * A list of linked tracking categories. + */ + public Builder trackingCategories(JsonNullable> trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = trackingCategories; + return this; + } + + + /** + * URL to the receipt or attachment for this expense line. + */ + public Builder receiptUrl(String receiptUrl) { + Utils.checkNotNull(receiptUrl, "receiptUrl"); + this.receiptUrl = JsonNullable.of(receiptUrl); + return this; + } + + /** + * URL to the receipt or attachment for this expense line. + */ + public Builder receiptUrl(JsonNullable receiptUrl) { + Utils.checkNotNull(receiptUrl, "receiptUrl"); + this.receiptUrl = receiptUrl; + return this; + } + + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public Builder currency(Currency currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public Builder currency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + public ExpenseReportLineItem build() { + + return new ExpenseReportLineItem( + id, expenseCategory, account, + description, quantity, unitPrice, + amount, taxRate, taxAmount, + totalAmount, transactionDate, billable, + reimbursable, customer, department, + location, trackingCategories, receiptUrl, + currency); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseReportLineItemExpenseCategory.java b/src/main/java/com/apideck/unify/models/components/ExpenseReportLineItemExpenseCategory.java new file mode 100644 index 000000000..93206b8ec --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ExpenseReportLineItemExpenseCategory.java @@ -0,0 +1,192 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Override; +import java.lang.String; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * ExpenseReportLineItemExpenseCategory + * + *

The expense category for this line item. + */ +public class ExpenseReportLineItemExpenseCategory { + /** + * A unique identifier for the expense category. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * The name of the expense category. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + @JsonCreator + public ExpenseReportLineItemExpenseCategory( + @JsonProperty("id") Optional id, + @JsonProperty("name") JsonNullable name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.name = name; + } + + public ExpenseReportLineItemExpenseCategory() { + this(Optional.empty(), JsonNullable.undefined()); + } + + /** + * A unique identifier for the expense category. + */ + @JsonIgnore + public Optional id() { + return id; + } + + /** + * The name of the expense category. + */ + @JsonIgnore + public JsonNullable name() { + return name; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * A unique identifier for the expense category. + */ + public ExpenseReportLineItemExpenseCategory withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + + /** + * A unique identifier for the expense category. + */ + public ExpenseReportLineItemExpenseCategory withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * The name of the expense category. + */ + public ExpenseReportLineItemExpenseCategory withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The name of the expense category. + */ + public ExpenseReportLineItemExpenseCategory withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExpenseReportLineItemExpenseCategory other = (ExpenseReportLineItemExpenseCategory) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, name); + } + + @Override + public String toString() { + return Utils.toString(ExpenseReportLineItemExpenseCategory.class, + "id", id, + "name", name); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional id = Optional.empty(); + + private JsonNullable name = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * A unique identifier for the expense category. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * A unique identifier for the expense category. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * The name of the expense category. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The name of the expense category. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public ExpenseReportLineItemExpenseCategory build() { + + return new ExpenseReportLineItemExpenseCategory( + id, name); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseReportLineItemInput.java b/src/main/java/com/apideck/unify/models/components/ExpenseReportLineItemInput.java new file mode 100644 index 000000000..78322ef46 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ExpenseReportLineItemInput.java @@ -0,0 +1,1047 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Boolean; +import java.lang.Double; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.LocalDate; +import java.util.List; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class ExpenseReportLineItemInput { + /** + * The expense category for this line item. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("expense_category") + private Optional expenseCategory; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("account") + private JsonNullable account; + + /** + * The description of the expense line item. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("description") + private JsonNullable description; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("quantity") + private JsonNullable quantity; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("unit_price") + private JsonNullable unitPrice; + + /** + * The amount of the expense line item. + */ + @JsonProperty("amount") + private double amount; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tax_rate") + private Optional taxRate; + + /** + * Tax amount + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tax_amount") + private JsonNullable taxAmount; + + /** + * The total amount of the expense line item including tax. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("total_amount") + private JsonNullable totalAmount; + + /** + * The date of the individual expense. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("transaction_date") + private JsonNullable transactionDate; + + /** + * Whether the expense is billable to a customer. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("billable") + private JsonNullable billable; + + /** + * Whether the expense is reimbursable to the employee. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("reimbursable") + private JsonNullable reimbursable; + + /** + * The customer this entity is linked to. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("customer") + private JsonNullable customer; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("department") + private JsonNullable department; + + + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("location") + private JsonNullable location; + + /** + * A list of linked tracking categories. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("tracking_categories") + private JsonNullable> trackingCategories; + + /** + * URL to the receipt or attachment for this expense line. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("receipt_url") + private JsonNullable receiptUrl; + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("currency") + private JsonNullable currency; + + @JsonCreator + public ExpenseReportLineItemInput( + @JsonProperty("expense_category") Optional expenseCategory, + @JsonProperty("account") JsonNullable account, + @JsonProperty("description") JsonNullable description, + @JsonProperty("quantity") JsonNullable quantity, + @JsonProperty("unit_price") JsonNullable unitPrice, + @JsonProperty("amount") double amount, + @JsonProperty("tax_rate") Optional taxRate, + @JsonProperty("tax_amount") JsonNullable taxAmount, + @JsonProperty("total_amount") JsonNullable totalAmount, + @JsonProperty("transaction_date") JsonNullable transactionDate, + @JsonProperty("billable") JsonNullable billable, + @JsonProperty("reimbursable") JsonNullable reimbursable, + @JsonProperty("customer") JsonNullable customer, + @JsonProperty("department") JsonNullable department, + @JsonProperty("location") JsonNullable location, + @JsonProperty("tracking_categories") JsonNullable> trackingCategories, + @JsonProperty("receipt_url") JsonNullable receiptUrl, + @JsonProperty("currency") JsonNullable currency) { + Utils.checkNotNull(expenseCategory, "expenseCategory"); + Utils.checkNotNull(account, "account"); + Utils.checkNotNull(description, "description"); + Utils.checkNotNull(quantity, "quantity"); + Utils.checkNotNull(unitPrice, "unitPrice"); + Utils.checkNotNull(amount, "amount"); + Utils.checkNotNull(taxRate, "taxRate"); + Utils.checkNotNull(taxAmount, "taxAmount"); + Utils.checkNotNull(totalAmount, "totalAmount"); + Utils.checkNotNull(transactionDate, "transactionDate"); + Utils.checkNotNull(billable, "billable"); + Utils.checkNotNull(reimbursable, "reimbursable"); + Utils.checkNotNull(customer, "customer"); + Utils.checkNotNull(department, "department"); + Utils.checkNotNull(location, "location"); + Utils.checkNotNull(trackingCategories, "trackingCategories"); + Utils.checkNotNull(receiptUrl, "receiptUrl"); + Utils.checkNotNull(currency, "currency"); + this.expenseCategory = expenseCategory; + this.account = account; + this.description = description; + this.quantity = quantity; + this.unitPrice = unitPrice; + this.amount = amount; + this.taxRate = taxRate; + this.taxAmount = taxAmount; + this.totalAmount = totalAmount; + this.transactionDate = transactionDate; + this.billable = billable; + this.reimbursable = reimbursable; + this.customer = customer; + this.department = department; + this.location = location; + this.trackingCategories = trackingCategories; + this.receiptUrl = receiptUrl; + this.currency = currency; + } + + public ExpenseReportLineItemInput( + double amount) { + this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), amount, + Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * The expense category for this line item. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional expenseCategory() { + return (Optional) expenseCategory; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable account() { + return (JsonNullable) account; + } + + /** + * The description of the expense line item. + */ + @JsonIgnore + public JsonNullable description() { + return description; + } + + @JsonIgnore + public JsonNullable quantity() { + return quantity; + } + + @JsonIgnore + public JsonNullable unitPrice() { + return unitPrice; + } + + /** + * The amount of the expense line item. + */ + @JsonIgnore + public double amount() { + return amount; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional taxRate() { + return (Optional) taxRate; + } + + /** + * Tax amount + */ + @JsonIgnore + public JsonNullable taxAmount() { + return taxAmount; + } + + /** + * The total amount of the expense line item including tax. + */ + @JsonIgnore + public JsonNullable totalAmount() { + return totalAmount; + } + + /** + * The date of the individual expense. + */ + @JsonIgnore + public JsonNullable transactionDate() { + return transactionDate; + } + + /** + * Whether the expense is billable to a customer. + */ + @JsonIgnore + public JsonNullable billable() { + return billable; + } + + /** + * Whether the expense is reimbursable to the employee. + */ + @JsonIgnore + public JsonNullable reimbursable() { + return reimbursable; + } + + /** + * The customer this entity is linked to. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable customer() { + return (JsonNullable) customer; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable department() { + return (JsonNullable) department; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable location() { + return (JsonNullable) location; + } + + /** + * A list of linked tracking categories. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> trackingCategories() { + return (JsonNullable>) trackingCategories; + } + + /** + * URL to the receipt or attachment for this expense line. + */ + @JsonIgnore + public JsonNullable receiptUrl() { + return receiptUrl; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable currency() { + return (JsonNullable) currency; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The expense category for this line item. + */ + public ExpenseReportLineItemInput withExpenseCategory(ExpenseReportLineItemExpenseCategory expenseCategory) { + Utils.checkNotNull(expenseCategory, "expenseCategory"); + this.expenseCategory = Optional.ofNullable(expenseCategory); + return this; + } + + + /** + * The expense category for this line item. + */ + public ExpenseReportLineItemInput withExpenseCategory(Optional expenseCategory) { + Utils.checkNotNull(expenseCategory, "expenseCategory"); + this.expenseCategory = expenseCategory; + return this; + } + + public ExpenseReportLineItemInput withAccount(LinkedLedgerAccount account) { + Utils.checkNotNull(account, "account"); + this.account = JsonNullable.of(account); + return this; + } + + public ExpenseReportLineItemInput withAccount(JsonNullable account) { + Utils.checkNotNull(account, "account"); + this.account = account; + return this; + } + + /** + * The description of the expense line item. + */ + public ExpenseReportLineItemInput withDescription(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * The description of the expense line item. + */ + public ExpenseReportLineItemInput withDescription(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + public ExpenseReportLineItemInput withQuantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = JsonNullable.of(quantity); + return this; + } + + public ExpenseReportLineItemInput withQuantity(JsonNullable quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + public ExpenseReportLineItemInput withUnitPrice(double unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = JsonNullable.of(unitPrice); + return this; + } + + public ExpenseReportLineItemInput withUnitPrice(JsonNullable unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = unitPrice; + return this; + } + + /** + * The amount of the expense line item. + */ + public ExpenseReportLineItemInput withAmount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + public ExpenseReportLineItemInput withTaxRate(LinkedTaxRateInput taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + + public ExpenseReportLineItemInput withTaxRate(Optional taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = taxRate; + return this; + } + + /** + * Tax amount + */ + public ExpenseReportLineItemInput withTaxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * Tax amount + */ + public ExpenseReportLineItemInput withTaxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + /** + * The total amount of the expense line item including tax. + */ + public ExpenseReportLineItemInput withTotalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * The total amount of the expense line item including tax. + */ + public ExpenseReportLineItemInput withTotalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + /** + * The date of the individual expense. + */ + public ExpenseReportLineItemInput withTransactionDate(LocalDate transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = JsonNullable.of(transactionDate); + return this; + } + + /** + * The date of the individual expense. + */ + public ExpenseReportLineItemInput withTransactionDate(JsonNullable transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = transactionDate; + return this; + } + + /** + * Whether the expense is billable to a customer. + */ + public ExpenseReportLineItemInput withBillable(boolean billable) { + Utils.checkNotNull(billable, "billable"); + this.billable = JsonNullable.of(billable); + return this; + } + + /** + * Whether the expense is billable to a customer. + */ + public ExpenseReportLineItemInput withBillable(JsonNullable billable) { + Utils.checkNotNull(billable, "billable"); + this.billable = billable; + return this; + } + + /** + * Whether the expense is reimbursable to the employee. + */ + public ExpenseReportLineItemInput withReimbursable(boolean reimbursable) { + Utils.checkNotNull(reimbursable, "reimbursable"); + this.reimbursable = JsonNullable.of(reimbursable); + return this; + } + + /** + * Whether the expense is reimbursable to the employee. + */ + public ExpenseReportLineItemInput withReimbursable(JsonNullable reimbursable) { + Utils.checkNotNull(reimbursable, "reimbursable"); + this.reimbursable = reimbursable; + return this; + } + + /** + * The customer this entity is linked to. + */ + public ExpenseReportLineItemInput withCustomer(LinkedCustomerInput customer) { + Utils.checkNotNull(customer, "customer"); + this.customer = JsonNullable.of(customer); + return this; + } + + /** + * The customer this entity is linked to. + */ + public ExpenseReportLineItemInput withCustomer(JsonNullable customer) { + Utils.checkNotNull(customer, "customer"); + this.customer = customer; + return this; + } + + public ExpenseReportLineItemInput withDepartment(LinkedDepartmentInput department) { + Utils.checkNotNull(department, "department"); + this.department = JsonNullable.of(department); + return this; + } + + public ExpenseReportLineItemInput withDepartment(JsonNullable department) { + Utils.checkNotNull(department, "department"); + this.department = department; + return this; + } + + public ExpenseReportLineItemInput withLocation(LinkedLocationInput location) { + Utils.checkNotNull(location, "location"); + this.location = JsonNullable.of(location); + return this; + } + + public ExpenseReportLineItemInput withLocation(JsonNullable location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + /** + * A list of linked tracking categories. + */ + public ExpenseReportLineItemInput withTrackingCategories(List trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = JsonNullable.of(trackingCategories); + return this; + } + + /** + * A list of linked tracking categories. + */ + public ExpenseReportLineItemInput withTrackingCategories(JsonNullable> trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = trackingCategories; + return this; + } + + /** + * URL to the receipt or attachment for this expense line. + */ + public ExpenseReportLineItemInput withReceiptUrl(String receiptUrl) { + Utils.checkNotNull(receiptUrl, "receiptUrl"); + this.receiptUrl = JsonNullable.of(receiptUrl); + return this; + } + + /** + * URL to the receipt or attachment for this expense line. + */ + public ExpenseReportLineItemInput withReceiptUrl(JsonNullable receiptUrl) { + Utils.checkNotNull(receiptUrl, "receiptUrl"); + this.receiptUrl = receiptUrl; + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public ExpenseReportLineItemInput withCurrency(Currency currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public ExpenseReportLineItemInput withCurrency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExpenseReportLineItemInput other = (ExpenseReportLineItemInput) o; + return + Utils.enhancedDeepEquals(this.expenseCategory, other.expenseCategory) && + Utils.enhancedDeepEquals(this.account, other.account) && + Utils.enhancedDeepEquals(this.description, other.description) && + Utils.enhancedDeepEquals(this.quantity, other.quantity) && + Utils.enhancedDeepEquals(this.unitPrice, other.unitPrice) && + Utils.enhancedDeepEquals(this.amount, other.amount) && + Utils.enhancedDeepEquals(this.taxRate, other.taxRate) && + Utils.enhancedDeepEquals(this.taxAmount, other.taxAmount) && + Utils.enhancedDeepEquals(this.totalAmount, other.totalAmount) && + Utils.enhancedDeepEquals(this.transactionDate, other.transactionDate) && + Utils.enhancedDeepEquals(this.billable, other.billable) && + Utils.enhancedDeepEquals(this.reimbursable, other.reimbursable) && + Utils.enhancedDeepEquals(this.customer, other.customer) && + Utils.enhancedDeepEquals(this.department, other.department) && + Utils.enhancedDeepEquals(this.location, other.location) && + Utils.enhancedDeepEquals(this.trackingCategories, other.trackingCategories) && + Utils.enhancedDeepEquals(this.receiptUrl, other.receiptUrl) && + Utils.enhancedDeepEquals(this.currency, other.currency); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + expenseCategory, account, description, + quantity, unitPrice, amount, + taxRate, taxAmount, totalAmount, + transactionDate, billable, reimbursable, + customer, department, location, + trackingCategories, receiptUrl, currency); + } + + @Override + public String toString() { + return Utils.toString(ExpenseReportLineItemInput.class, + "expenseCategory", expenseCategory, + "account", account, + "description", description, + "quantity", quantity, + "unitPrice", unitPrice, + "amount", amount, + "taxRate", taxRate, + "taxAmount", taxAmount, + "totalAmount", totalAmount, + "transactionDate", transactionDate, + "billable", billable, + "reimbursable", reimbursable, + "customer", customer, + "department", department, + "location", location, + "trackingCategories", trackingCategories, + "receiptUrl", receiptUrl, + "currency", currency); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional expenseCategory = Optional.empty(); + + private JsonNullable account = JsonNullable.undefined(); + + private JsonNullable description = JsonNullable.undefined(); + + private JsonNullable quantity = JsonNullable.undefined(); + + private JsonNullable unitPrice = JsonNullable.undefined(); + + private Double amount; + + private Optional taxRate = Optional.empty(); + + private JsonNullable taxAmount = JsonNullable.undefined(); + + private JsonNullable totalAmount = JsonNullable.undefined(); + + private JsonNullable transactionDate = JsonNullable.undefined(); + + private JsonNullable billable = JsonNullable.undefined(); + + private JsonNullable reimbursable = JsonNullable.undefined(); + + private JsonNullable customer = JsonNullable.undefined(); + + private JsonNullable department = JsonNullable.undefined(); + + private JsonNullable location = JsonNullable.undefined(); + + private JsonNullable> trackingCategories = JsonNullable.undefined(); + + private JsonNullable receiptUrl = JsonNullable.undefined(); + + private JsonNullable currency = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * The expense category for this line item. + */ + public Builder expenseCategory(ExpenseReportLineItemExpenseCategory expenseCategory) { + Utils.checkNotNull(expenseCategory, "expenseCategory"); + this.expenseCategory = Optional.ofNullable(expenseCategory); + return this; + } + + /** + * The expense category for this line item. + */ + public Builder expenseCategory(Optional expenseCategory) { + Utils.checkNotNull(expenseCategory, "expenseCategory"); + this.expenseCategory = expenseCategory; + return this; + } + + + public Builder account(LinkedLedgerAccount account) { + Utils.checkNotNull(account, "account"); + this.account = JsonNullable.of(account); + return this; + } + + public Builder account(JsonNullable account) { + Utils.checkNotNull(account, "account"); + this.account = account; + return this; + } + + + /** + * The description of the expense line item. + */ + public Builder description(String description) { + Utils.checkNotNull(description, "description"); + this.description = JsonNullable.of(description); + return this; + } + + /** + * The description of the expense line item. + */ + public Builder description(JsonNullable description) { + Utils.checkNotNull(description, "description"); + this.description = description; + return this; + } + + + public Builder quantity(double quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = JsonNullable.of(quantity); + return this; + } + + public Builder quantity(JsonNullable quantity) { + Utils.checkNotNull(quantity, "quantity"); + this.quantity = quantity; + return this; + } + + + public Builder unitPrice(double unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = JsonNullable.of(unitPrice); + return this; + } + + public Builder unitPrice(JsonNullable unitPrice) { + Utils.checkNotNull(unitPrice, "unitPrice"); + this.unitPrice = unitPrice; + return this; + } + + + /** + * The amount of the expense line item. + */ + public Builder amount(double amount) { + Utils.checkNotNull(amount, "amount"); + this.amount = amount; + return this; + } + + + public Builder taxRate(LinkedTaxRateInput taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + public Builder taxRate(Optional taxRate) { + Utils.checkNotNull(taxRate, "taxRate"); + this.taxRate = taxRate; + return this; + } + + + /** + * Tax amount + */ + public Builder taxAmount(double taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = JsonNullable.of(taxAmount); + return this; + } + + /** + * Tax amount + */ + public Builder taxAmount(JsonNullable taxAmount) { + Utils.checkNotNull(taxAmount, "taxAmount"); + this.taxAmount = taxAmount; + return this; + } + + + /** + * The total amount of the expense line item including tax. + */ + public Builder totalAmount(double totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = JsonNullable.of(totalAmount); + return this; + } + + /** + * The total amount of the expense line item including tax. + */ + public Builder totalAmount(JsonNullable totalAmount) { + Utils.checkNotNull(totalAmount, "totalAmount"); + this.totalAmount = totalAmount; + return this; + } + + + /** + * The date of the individual expense. + */ + public Builder transactionDate(LocalDate transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = JsonNullable.of(transactionDate); + return this; + } + + /** + * The date of the individual expense. + */ + public Builder transactionDate(JsonNullable transactionDate) { + Utils.checkNotNull(transactionDate, "transactionDate"); + this.transactionDate = transactionDate; + return this; + } + + + /** + * Whether the expense is billable to a customer. + */ + public Builder billable(boolean billable) { + Utils.checkNotNull(billable, "billable"); + this.billable = JsonNullable.of(billable); + return this; + } + + /** + * Whether the expense is billable to a customer. + */ + public Builder billable(JsonNullable billable) { + Utils.checkNotNull(billable, "billable"); + this.billable = billable; + return this; + } + + + /** + * Whether the expense is reimbursable to the employee. + */ + public Builder reimbursable(boolean reimbursable) { + Utils.checkNotNull(reimbursable, "reimbursable"); + this.reimbursable = JsonNullable.of(reimbursable); + return this; + } + + /** + * Whether the expense is reimbursable to the employee. + */ + public Builder reimbursable(JsonNullable reimbursable) { + Utils.checkNotNull(reimbursable, "reimbursable"); + this.reimbursable = reimbursable; + return this; + } + + + /** + * The customer this entity is linked to. + */ + public Builder customer(LinkedCustomerInput customer) { + Utils.checkNotNull(customer, "customer"); + this.customer = JsonNullable.of(customer); + return this; + } + + /** + * The customer this entity is linked to. + */ + public Builder customer(JsonNullable customer) { + Utils.checkNotNull(customer, "customer"); + this.customer = customer; + return this; + } + + + public Builder department(LinkedDepartmentInput department) { + Utils.checkNotNull(department, "department"); + this.department = JsonNullable.of(department); + return this; + } + + public Builder department(JsonNullable department) { + Utils.checkNotNull(department, "department"); + this.department = department; + return this; + } + + + public Builder location(LinkedLocationInput location) { + Utils.checkNotNull(location, "location"); + this.location = JsonNullable.of(location); + return this; + } + + public Builder location(JsonNullable location) { + Utils.checkNotNull(location, "location"); + this.location = location; + return this; + } + + + /** + * A list of linked tracking categories. + */ + public Builder trackingCategories(List trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = JsonNullable.of(trackingCategories); + return this; + } + + /** + * A list of linked tracking categories. + */ + public Builder trackingCategories(JsonNullable> trackingCategories) { + Utils.checkNotNull(trackingCategories, "trackingCategories"); + this.trackingCategories = trackingCategories; + return this; + } + + + /** + * URL to the receipt or attachment for this expense line. + */ + public Builder receiptUrl(String receiptUrl) { + Utils.checkNotNull(receiptUrl, "receiptUrl"); + this.receiptUrl = JsonNullable.of(receiptUrl); + return this; + } + + /** + * URL to the receipt or attachment for this expense line. + */ + public Builder receiptUrl(JsonNullable receiptUrl) { + Utils.checkNotNull(receiptUrl, "receiptUrl"); + this.receiptUrl = receiptUrl; + return this; + } + + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public Builder currency(Currency currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = JsonNullable.of(currency); + return this; + } + + /** + * Indicates the associated currency for an amount of money. Values correspond to [ISO + * 4217](https://en.wikipedia.org/wiki/ISO_4217). + */ + public Builder currency(JsonNullable currency) { + Utils.checkNotNull(currency, "currency"); + this.currency = currency; + return this; + } + + public ExpenseReportLineItemInput build() { + + return new ExpenseReportLineItemInput( + expenseCategory, account, description, + quantity, unitPrice, amount, + taxRate, taxAmount, totalAmount, + transactionDate, billable, reimbursable, + customer, department, location, + trackingCategories, receiptUrl, currency); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseReportStatus.java b/src/main/java/com/apideck/unify/models/components/ExpenseReportStatus.java new file mode 100644 index 000000000..2fcbc308a --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ExpenseReportStatus.java @@ -0,0 +1,152 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.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. + */ +/** + * ExpenseReportStatus + * + *

The status of the expense report. + */ +public class ExpenseReportStatus { + + public static final ExpenseReportStatus DRAFT = new ExpenseReportStatus("draft"); + public static final ExpenseReportStatus SUBMITTED = new ExpenseReportStatus("submitted"); + public static final ExpenseReportStatus APPROVED = new ExpenseReportStatus("approved"); + public static final ExpenseReportStatus REIMBURSED = new ExpenseReportStatus("reimbursed"); + public static final ExpenseReportStatus REJECTED = new ExpenseReportStatus("rejected"); + public static final ExpenseReportStatus REVERSED = new ExpenseReportStatus("reversed"); + public static final ExpenseReportStatus VOIDED = new ExpenseReportStatus("voided"); + + // 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 ExpenseReportStatus(String value) { + this.value = value; + } + + /** + * Returns a ExpenseReportStatus 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 ExpenseReportStatus + */ + @JsonCreator + public static ExpenseReportStatus of(String value) { + synchronized (ExpenseReportStatus.class) { + return values.computeIfAbsent(value, v -> new ExpenseReportStatus(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; + ExpenseReportStatus other = (ExpenseReportStatus) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "ExpenseReportStatus [value=" + value + "]"; + } + + // return an array just like an enum + public static ExpenseReportStatus[] values() { + synchronized (ExpenseReportStatus.class) { + return values.values().toArray(new ExpenseReportStatus[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("draft", DRAFT); + map.put("submitted", SUBMITTED); + map.put("approved", APPROVED); + map.put("reimbursed", REIMBURSED); + map.put("rejected", REJECTED); + map.put("reversed", REVERSED); + map.put("voided", VOIDED); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("draft", ExpenseReportStatusEnum.DRAFT); + map.put("submitted", ExpenseReportStatusEnum.SUBMITTED); + map.put("approved", ExpenseReportStatusEnum.APPROVED); + map.put("reimbursed", ExpenseReportStatusEnum.REIMBURSED); + map.put("rejected", ExpenseReportStatusEnum.REJECTED); + map.put("reversed", ExpenseReportStatusEnum.REVERSED); + map.put("voided", ExpenseReportStatusEnum.VOIDED); + return map; + } + + + public enum ExpenseReportStatusEnum { + + DRAFT("draft"), + SUBMITTED("submitted"), + APPROVED("approved"), + REIMBURSED("reimbursed"), + REJECTED("rejected"), + REVERSED("reversed"), + VOIDED("voided"),; + + private final String value; + + private ExpenseReportStatusEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} + diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseReportsFilter.java b/src/main/java/com/apideck/unify/models/components/ExpenseReportsFilter.java new file mode 100644 index 000000000..9d4dfd8b9 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ExpenseReportsFilter.java @@ -0,0 +1,212 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.OffsetDateTime; +import java.util.Optional; + + +public class ExpenseReportsFilter { + + @SpeakeasyMetadata("queryParam:name=updated_since") + private Optional updatedSince; + + + @SpeakeasyMetadata("queryParam:name=status") + private Optional status; + + /** + * Filter by employee ID + */ + @SpeakeasyMetadata("queryParam:name=employee_id") + private Optional employeeId; + + @JsonCreator + public ExpenseReportsFilter( + Optional updatedSince, + Optional status, + Optional employeeId) { + Utils.checkNotNull(updatedSince, "updatedSince"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(employeeId, "employeeId"); + this.updatedSince = updatedSince; + this.status = status; + this.employeeId = employeeId; + } + + public ExpenseReportsFilter() { + this(Optional.empty(), Optional.empty(), Optional.empty()); + } + + @JsonIgnore + public Optional updatedSince() { + return updatedSince; + } + + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional status() { + return (Optional) status; + } + + /** + * Filter by employee ID + */ + @JsonIgnore + public Optional employeeId() { + return employeeId; + } + + public static Builder builder() { + return new Builder(); + } + + + public ExpenseReportsFilter withUpdatedSince(OffsetDateTime updatedSince) { + Utils.checkNotNull(updatedSince, "updatedSince"); + this.updatedSince = Optional.ofNullable(updatedSince); + return this; + } + + + public ExpenseReportsFilter withUpdatedSince(Optional updatedSince) { + Utils.checkNotNull(updatedSince, "updatedSince"); + this.updatedSince = updatedSince; + return this; + } + + public ExpenseReportsFilter withStatus(ExpenseReportsFilterStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + + public ExpenseReportsFilter withStatus(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Filter by employee ID + */ + public ExpenseReportsFilter withEmployeeId(String employeeId) { + Utils.checkNotNull(employeeId, "employeeId"); + this.employeeId = Optional.ofNullable(employeeId); + return this; + } + + + /** + * Filter by employee ID + */ + public ExpenseReportsFilter withEmployeeId(Optional employeeId) { + Utils.checkNotNull(employeeId, "employeeId"); + this.employeeId = employeeId; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExpenseReportsFilter other = (ExpenseReportsFilter) o; + return + Utils.enhancedDeepEquals(this.updatedSince, other.updatedSince) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.employeeId, other.employeeId); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + updatedSince, status, employeeId); + } + + @Override + public String toString() { + return Utils.toString(ExpenseReportsFilter.class, + "updatedSince", updatedSince, + "status", status, + "employeeId", employeeId); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional updatedSince = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional employeeId = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + public Builder updatedSince(OffsetDateTime updatedSince) { + Utils.checkNotNull(updatedSince, "updatedSince"); + this.updatedSince = Optional.ofNullable(updatedSince); + return this; + } + + public Builder updatedSince(Optional updatedSince) { + Utils.checkNotNull(updatedSince, "updatedSince"); + this.updatedSince = updatedSince; + return this; + } + + + public Builder status(ExpenseReportsFilterStatus status) { + Utils.checkNotNull(status, "status"); + this.status = Optional.ofNullable(status); + return this; + } + + public Builder status(Optional status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Filter by employee ID + */ + public Builder employeeId(String employeeId) { + Utils.checkNotNull(employeeId, "employeeId"); + this.employeeId = Optional.ofNullable(employeeId); + return this; + } + + /** + * Filter by employee ID + */ + public Builder employeeId(Optional employeeId) { + Utils.checkNotNull(employeeId, "employeeId"); + this.employeeId = employeeId; + return this; + } + + public ExpenseReportsFilter build() { + + return new ExpenseReportsFilter( + updatedSince, status, employeeId); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseReportsFilterStatus.java b/src/main/java/com/apideck/unify/models/components/ExpenseReportsFilterStatus.java new file mode 100644 index 000000000..1ca93628d --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/ExpenseReportsFilterStatus.java @@ -0,0 +1,147 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.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 ExpenseReportsFilterStatus { + + public static final ExpenseReportsFilterStatus DRAFT = new ExpenseReportsFilterStatus("draft"); + public static final ExpenseReportsFilterStatus SUBMITTED = new ExpenseReportsFilterStatus("submitted"); + public static final ExpenseReportsFilterStatus APPROVED = new ExpenseReportsFilterStatus("approved"); + public static final ExpenseReportsFilterStatus REIMBURSED = new ExpenseReportsFilterStatus("reimbursed"); + public static final ExpenseReportsFilterStatus REJECTED = new ExpenseReportsFilterStatus("rejected"); + public static final ExpenseReportsFilterStatus REVERSED = new ExpenseReportsFilterStatus("reversed"); + public static final ExpenseReportsFilterStatus VOIDED = new ExpenseReportsFilterStatus("voided"); + + // 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 ExpenseReportsFilterStatus(String value) { + this.value = value; + } + + /** + * Returns a ExpenseReportsFilterStatus 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 ExpenseReportsFilterStatus + */ + @JsonCreator + public static ExpenseReportsFilterStatus of(String value) { + synchronized (ExpenseReportsFilterStatus.class) { + return values.computeIfAbsent(value, v -> new ExpenseReportsFilterStatus(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; + ExpenseReportsFilterStatus other = (ExpenseReportsFilterStatus) obj; + return Objects.equals(value, other.value); + } + + @Override + public String toString() { + return "ExpenseReportsFilterStatus [value=" + value + "]"; + } + + // return an array just like an enum + public static ExpenseReportsFilterStatus[] values() { + synchronized (ExpenseReportsFilterStatus.class) { + return values.values().toArray(new ExpenseReportsFilterStatus[] {}); + } + } + + private static final Map createValuesMap() { + Map map = new LinkedHashMap<>(); + map.put("draft", DRAFT); + map.put("submitted", SUBMITTED); + map.put("approved", APPROVED); + map.put("reimbursed", REIMBURSED); + map.put("rejected", REJECTED); + map.put("reversed", REVERSED); + map.put("voided", VOIDED); + return map; + } + + private static final Map createEnumsMap() { + Map map = new HashMap<>(); + map.put("draft", ExpenseReportsFilterStatusEnum.DRAFT); + map.put("submitted", ExpenseReportsFilterStatusEnum.SUBMITTED); + map.put("approved", ExpenseReportsFilterStatusEnum.APPROVED); + map.put("reimbursed", ExpenseReportsFilterStatusEnum.REIMBURSED); + map.put("rejected", ExpenseReportsFilterStatusEnum.REJECTED); + map.put("reversed", ExpenseReportsFilterStatusEnum.REVERSED); + map.put("voided", ExpenseReportsFilterStatusEnum.VOIDED); + return map; + } + + + public enum ExpenseReportsFilterStatusEnum { + + DRAFT("draft"), + SUBMITTED("submitted"), + APPROVED("approved"), + REIMBURSED("reimbursed"), + REJECTED("rejected"), + REVERSED("reversed"), + VOIDED("voided"),; + + private final String value; + + private ExpenseReportsFilterStatusEnum(String value) { + this.value = value; + } + + public String value() { + return value; + } + } +} + diff --git a/src/main/java/com/apideck/unify/models/components/GetAccountingEmployeeResponse.java b/src/main/java/com/apideck/unify/models/components/GetAccountingEmployeeResponse.java new file mode 100644 index 000000000..a132b6190 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/GetAccountingEmployeeResponse.java @@ -0,0 +1,377 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * GetAccountingEmployeeResponse + * + *

Employees + */ +public class GetAccountingEmployeeResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + + @JsonProperty("data") + private AccountingEmployee data; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public GetAccountingEmployeeResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") AccountingEmployee data, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.raw = raw; + } + + public GetAccountingEmployeeResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + AccountingEmployee data) { + this(statusCode, status, service, + resource, operation, data, + JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + @JsonIgnore + public AccountingEmployee data() { + return data; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public GetAccountingEmployeeResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public GetAccountingEmployeeResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public GetAccountingEmployeeResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public GetAccountingEmployeeResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public GetAccountingEmployeeResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + public GetAccountingEmployeeResponse withData(AccountingEmployee data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public GetAccountingEmployeeResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public GetAccountingEmployeeResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingEmployeeResponse other = (GetAccountingEmployeeResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + raw); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingEmployeeResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private AccountingEmployee data; + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + public Builder data(AccountingEmployee data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public GetAccountingEmployeeResponse build() { + + return new GetAccountingEmployeeResponse( + statusCode, status, service, + resource, operation, data, + raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/GetAccountingEmployeesResponse.java b/src/main/java/com/apideck/unify/models/components/GetAccountingEmployeesResponse.java new file mode 100644 index 000000000..2b43e4952 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/GetAccountingEmployeesResponse.java @@ -0,0 +1,501 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * GetAccountingEmployeesResponse + * + *

Employees + */ +public class GetAccountingEmployeesResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + + @JsonProperty("data") + private List data; + + /** + * Response metadata + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("meta") + private Optional meta; + + /** + * Links to navigate to previous or next pages through the API + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("links") + private Optional links; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public GetAccountingEmployeesResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") List data, + @JsonProperty("meta") Optional meta, + @JsonProperty("links") Optional links, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(meta, "meta"); + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.meta = meta; + this.links = links; + this.raw = raw; + } + + public GetAccountingEmployeesResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + List data) { + this(statusCode, status, service, + resource, operation, data, + Optional.empty(), Optional.empty(), JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + @JsonIgnore + public List data() { + return data; + } + + /** + * Response metadata + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional meta() { + return (Optional) meta; + } + + /** + * Links to navigate to previous or next pages through the API + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional links() { + return (Optional) links; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public GetAccountingEmployeesResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public GetAccountingEmployeesResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public GetAccountingEmployeesResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public GetAccountingEmployeesResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public GetAccountingEmployeesResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + public GetAccountingEmployeesResponse withData(List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Response metadata + */ + public GetAccountingEmployeesResponse withMeta(Meta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + + /** + * Response metadata + */ + public GetAccountingEmployeesResponse withMeta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } + + /** + * Links to navigate to previous or next pages through the API + */ + public GetAccountingEmployeesResponse withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = Optional.ofNullable(links); + return this; + } + + + /** + * Links to navigate to previous or next pages through the API + */ + public GetAccountingEmployeesResponse withLinks(Optional links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public GetAccountingEmployeesResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public GetAccountingEmployeesResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAccountingEmployeesResponse other = (GetAccountingEmployeesResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.meta, other.meta) && + Utils.enhancedDeepEquals(this.links, other.links) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + meta, links, raw); + } + + @Override + public String toString() { + return Utils.toString(GetAccountingEmployeesResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "meta", meta, + "links", links, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private List data; + + private Optional meta = Optional.empty(); + + private Optional links = Optional.empty(); + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + public Builder data(List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Response metadata + */ + public Builder meta(Meta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + /** + * Response metadata + */ + public Builder meta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } + + + /** + * Links to navigate to previous or next pages through the API + */ + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = Optional.ofNullable(links); + return this; + } + + /** + * Links to navigate to previous or next pages through the API + */ + public Builder links(Optional links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public GetAccountingEmployeesResponse build() { + + return new GetAccountingEmployeesResponse( + statusCode, status, service, + resource, operation, data, + meta, links, raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/GetExpenseCategoriesResponse.java b/src/main/java/com/apideck/unify/models/components/GetExpenseCategoriesResponse.java new file mode 100644 index 000000000..e6e5a3720 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/GetExpenseCategoriesResponse.java @@ -0,0 +1,501 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * GetExpenseCategoriesResponse + * + *

Expense Categories + */ +public class GetExpenseCategoriesResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + + @JsonProperty("data") + private List data; + + /** + * Response metadata + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("meta") + private Optional meta; + + /** + * Links to navigate to previous or next pages through the API + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("links") + private Optional links; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public GetExpenseCategoriesResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") List data, + @JsonProperty("meta") Optional meta, + @JsonProperty("links") Optional links, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(meta, "meta"); + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.meta = meta; + this.links = links; + this.raw = raw; + } + + public GetExpenseCategoriesResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + List data) { + this(statusCode, status, service, + resource, operation, data, + Optional.empty(), Optional.empty(), JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + @JsonIgnore + public List data() { + return data; + } + + /** + * Response metadata + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional meta() { + return (Optional) meta; + } + + /** + * Links to navigate to previous or next pages through the API + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional links() { + return (Optional) links; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public GetExpenseCategoriesResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public GetExpenseCategoriesResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public GetExpenseCategoriesResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public GetExpenseCategoriesResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public GetExpenseCategoriesResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + public GetExpenseCategoriesResponse withData(List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Response metadata + */ + public GetExpenseCategoriesResponse withMeta(Meta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + + /** + * Response metadata + */ + public GetExpenseCategoriesResponse withMeta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } + + /** + * Links to navigate to previous or next pages through the API + */ + public GetExpenseCategoriesResponse withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = Optional.ofNullable(links); + return this; + } + + + /** + * Links to navigate to previous or next pages through the API + */ + public GetExpenseCategoriesResponse withLinks(Optional links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public GetExpenseCategoriesResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public GetExpenseCategoriesResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExpenseCategoriesResponse other = (GetExpenseCategoriesResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.meta, other.meta) && + Utils.enhancedDeepEquals(this.links, other.links) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + meta, links, raw); + } + + @Override + public String toString() { + return Utils.toString(GetExpenseCategoriesResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "meta", meta, + "links", links, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private List data; + + private Optional meta = Optional.empty(); + + private Optional links = Optional.empty(); + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + public Builder data(List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Response metadata + */ + public Builder meta(Meta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + /** + * Response metadata + */ + public Builder meta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } + + + /** + * Links to navigate to previous or next pages through the API + */ + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = Optional.ofNullable(links); + return this; + } + + /** + * Links to navigate to previous or next pages through the API + */ + public Builder links(Optional links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public GetExpenseCategoriesResponse build() { + + return new GetExpenseCategoriesResponse( + statusCode, status, service, + resource, operation, data, + meta, links, raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/GetExpenseCategoryResponse.java b/src/main/java/com/apideck/unify/models/components/GetExpenseCategoryResponse.java new file mode 100644 index 000000000..4048b81c0 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/GetExpenseCategoryResponse.java @@ -0,0 +1,377 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * GetExpenseCategoryResponse + * + *

Expense Categories + */ +public class GetExpenseCategoryResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + + @JsonProperty("data") + private ExpenseCategory data; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public GetExpenseCategoryResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") ExpenseCategory data, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.raw = raw; + } + + public GetExpenseCategoryResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + ExpenseCategory data) { + this(statusCode, status, service, + resource, operation, data, + JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + @JsonIgnore + public ExpenseCategory data() { + return data; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public GetExpenseCategoryResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public GetExpenseCategoryResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public GetExpenseCategoryResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public GetExpenseCategoryResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public GetExpenseCategoryResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + public GetExpenseCategoryResponse withData(ExpenseCategory data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public GetExpenseCategoryResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public GetExpenseCategoryResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExpenseCategoryResponse other = (GetExpenseCategoryResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + raw); + } + + @Override + public String toString() { + return Utils.toString(GetExpenseCategoryResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private ExpenseCategory data; + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + public Builder data(ExpenseCategory data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public GetExpenseCategoryResponse build() { + + return new GetExpenseCategoryResponse( + statusCode, status, service, + resource, operation, data, + raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/GetExpenseReportResponse.java b/src/main/java/com/apideck/unify/models/components/GetExpenseReportResponse.java new file mode 100644 index 000000000..de372597a --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/GetExpenseReportResponse.java @@ -0,0 +1,377 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * GetExpenseReportResponse + * + *

Expense Reports + */ +public class GetExpenseReportResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + + @JsonProperty("data") + private ExpenseReport data; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public GetExpenseReportResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") ExpenseReport data, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.raw = raw; + } + + public GetExpenseReportResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + ExpenseReport data) { + this(statusCode, status, service, + resource, operation, data, + JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + @JsonIgnore + public ExpenseReport data() { + return data; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public GetExpenseReportResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public GetExpenseReportResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public GetExpenseReportResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public GetExpenseReportResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public GetExpenseReportResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + public GetExpenseReportResponse withData(ExpenseReport data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public GetExpenseReportResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public GetExpenseReportResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExpenseReportResponse other = (GetExpenseReportResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + raw); + } + + @Override + public String toString() { + return Utils.toString(GetExpenseReportResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private ExpenseReport data; + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + public Builder data(ExpenseReport data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public GetExpenseReportResponse build() { + + return new GetExpenseReportResponse( + statusCode, status, service, + resource, operation, data, + raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/GetExpenseReportsResponse.java b/src/main/java/com/apideck/unify/models/components/GetExpenseReportsResponse.java new file mode 100644 index 000000000..c6e17bfbd --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/GetExpenseReportsResponse.java @@ -0,0 +1,501 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * GetExpenseReportsResponse + * + *

Expense Reports + */ +public class GetExpenseReportsResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + + @JsonProperty("data") + private List data; + + /** + * Response metadata + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("meta") + private Optional meta; + + /** + * Links to navigate to previous or next pages through the API + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("links") + private Optional links; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public GetExpenseReportsResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") List data, + @JsonProperty("meta") Optional meta, + @JsonProperty("links") Optional links, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(meta, "meta"); + Utils.checkNotNull(links, "links"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.meta = meta; + this.links = links; + this.raw = raw; + } + + public GetExpenseReportsResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + List data) { + this(statusCode, status, service, + resource, operation, data, + Optional.empty(), Optional.empty(), JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + @JsonIgnore + public List data() { + return data; + } + + /** + * Response metadata + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional meta() { + return (Optional) meta; + } + + /** + * Links to navigate to previous or next pages through the API + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional links() { + return (Optional) links; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public GetExpenseReportsResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public GetExpenseReportsResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public GetExpenseReportsResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public GetExpenseReportsResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public GetExpenseReportsResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + public GetExpenseReportsResponse withData(List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Response metadata + */ + public GetExpenseReportsResponse withMeta(Meta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + + /** + * Response metadata + */ + public GetExpenseReportsResponse withMeta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } + + /** + * Links to navigate to previous or next pages through the API + */ + public GetExpenseReportsResponse withLinks(Links links) { + Utils.checkNotNull(links, "links"); + this.links = Optional.ofNullable(links); + return this; + } + + + /** + * Links to navigate to previous or next pages through the API + */ + public GetExpenseReportsResponse withLinks(Optional links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public GetExpenseReportsResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public GetExpenseReportsResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetExpenseReportsResponse other = (GetExpenseReportsResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.meta, other.meta) && + Utils.enhancedDeepEquals(this.links, other.links) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + meta, links, raw); + } + + @Override + public String toString() { + return Utils.toString(GetExpenseReportsResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "meta", meta, + "links", links, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private List data; + + private Optional meta = Optional.empty(); + + private Optional links = Optional.empty(); + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + public Builder data(List data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Response metadata + */ + public Builder meta(Meta meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = Optional.ofNullable(meta); + return this; + } + + /** + * Response metadata + */ + public Builder meta(Optional meta) { + Utils.checkNotNull(meta, "meta"); + this.meta = meta; + return this; + } + + + /** + * Links to navigate to previous or next pages through the API + */ + public Builder links(Links links) { + Utils.checkNotNull(links, "links"); + this.links = Optional.ofNullable(links); + return this; + } + + /** + * Links to navigate to previous or next pages through the API + */ + public Builder links(Optional links) { + Utils.checkNotNull(links, "links"); + this.links = links; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public GetExpenseReportsResponse build() { + + return new GetExpenseReportsResponse( + statusCode, status, service, + resource, operation, data, + meta, links, raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/LinkedSubsidiary.java b/src/main/java/com/apideck/unify/models/components/LinkedSubsidiary.java new file mode 100644 index 000000000..85f5a88e2 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/LinkedSubsidiary.java @@ -0,0 +1,247 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Override; +import java.lang.String; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class LinkedSubsidiary { + /** + * A unique identifier for an object. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("id") + private Optional id; + + /** + * Id to be displayed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("display_id") + private JsonNullable displayId; + + /** + * The name of the resource. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + @JsonCreator + public LinkedSubsidiary( + @JsonProperty("id") Optional id, + @JsonProperty("display_id") JsonNullable displayId, + @JsonProperty("name") JsonNullable name) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(displayId, "displayId"); + Utils.checkNotNull(name, "name"); + this.id = id; + this.displayId = displayId; + this.name = name; + } + + public LinkedSubsidiary() { + this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * A unique identifier for an object. + */ + @JsonIgnore + public Optional id() { + return id; + } + + /** + * Id to be displayed. + */ + @JsonIgnore + public JsonNullable displayId() { + return displayId; + } + + /** + * The name of the resource. + */ + @JsonIgnore + public JsonNullable name() { + return name; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * A unique identifier for an object. + */ + public LinkedSubsidiary withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + + /** + * A unique identifier for an object. + */ + public LinkedSubsidiary withId(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * Id to be displayed. + */ + public LinkedSubsidiary withDisplayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public LinkedSubsidiary withDisplayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + /** + * The name of the resource. + */ + public LinkedSubsidiary withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The name of the resource. + */ + public LinkedSubsidiary withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LinkedSubsidiary other = (LinkedSubsidiary) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.displayId, other.displayId) && + Utils.enhancedDeepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, displayId, name); + } + + @Override + public String toString() { + return Utils.toString(LinkedSubsidiary.class, + "id", id, + "displayId", displayId, + "name", name); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional id = Optional.empty(); + + private JsonNullable displayId = JsonNullable.undefined(); + + private JsonNullable name = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * A unique identifier for an object. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = Optional.ofNullable(id); + return this; + } + + /** + * A unique identifier for an object. + */ + public Builder id(Optional id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * Id to be displayed. + */ + public Builder displayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public Builder displayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + + /** + * The name of the resource. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The name of the resource. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public LinkedSubsidiary build() { + + return new LinkedSubsidiary( + id, displayId, name); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/LinkedSubsidiaryInput.java b/src/main/java/com/apideck/unify/models/components/LinkedSubsidiaryInput.java new file mode 100644 index 000000000..bb33c2e9f --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/LinkedSubsidiaryInput.java @@ -0,0 +1,186 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Override; +import java.lang.String; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class LinkedSubsidiaryInput { + /** + * Id to be displayed. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("display_id") + private JsonNullable displayId; + + /** + * The name of the resource. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("name") + private JsonNullable name; + + @JsonCreator + public LinkedSubsidiaryInput( + @JsonProperty("display_id") JsonNullable displayId, + @JsonProperty("name") JsonNullable name) { + Utils.checkNotNull(displayId, "displayId"); + Utils.checkNotNull(name, "name"); + this.displayId = displayId; + this.name = name; + } + + public LinkedSubsidiaryInput() { + this(JsonNullable.undefined(), JsonNullable.undefined()); + } + + /** + * Id to be displayed. + */ + @JsonIgnore + public JsonNullable displayId() { + return displayId; + } + + /** + * The name of the resource. + */ + @JsonIgnore + public JsonNullable name() { + return name; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Id to be displayed. + */ + public LinkedSubsidiaryInput withDisplayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public LinkedSubsidiaryInput withDisplayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + /** + * The name of the resource. + */ + public LinkedSubsidiaryInput withName(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The name of the resource. + */ + public LinkedSubsidiaryInput withName(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LinkedSubsidiaryInput other = (LinkedSubsidiaryInput) o; + return + Utils.enhancedDeepEquals(this.displayId, other.displayId) && + Utils.enhancedDeepEquals(this.name, other.name); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + displayId, name); + } + + @Override + public String toString() { + return Utils.toString(LinkedSubsidiaryInput.class, + "displayId", displayId, + "name", name); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private JsonNullable displayId = JsonNullable.undefined(); + + private JsonNullable name = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * Id to be displayed. + */ + public Builder displayId(String displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = JsonNullable.of(displayId); + return this; + } + + /** + * Id to be displayed. + */ + public Builder displayId(JsonNullable displayId) { + Utils.checkNotNull(displayId, "displayId"); + this.displayId = displayId; + return this; + } + + + /** + * The name of the resource. + */ + public Builder name(String name) { + Utils.checkNotNull(name, "name"); + this.name = JsonNullable.of(name); + return this; + } + + /** + * The name of the resource. + */ + public Builder name(JsonNullable name) { + Utils.checkNotNull(name, "name"); + this.name = name; + return this; + } + + public LinkedSubsidiaryInput build() { + + return new LinkedSubsidiaryInput( + displayId, name); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/UpdateAccountingEmployeeResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateAccountingEmployeeResponse.java new file mode 100644 index 000000000..29fb6728f --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/UpdateAccountingEmployeeResponse.java @@ -0,0 +1,388 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * UpdateAccountingEmployeeResponse + * + *

Employees + */ +public class UpdateAccountingEmployeeResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonProperty("data") + private UnifiedId data; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public UpdateAccountingEmployeeResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") UnifiedId data, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.raw = raw; + } + + public UpdateAccountingEmployeeResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + UnifiedId data) { + this(statusCode, status, service, + resource, operation, data, + JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonIgnore + public UnifiedId data() { + return data; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public UpdateAccountingEmployeeResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public UpdateAccountingEmployeeResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public UpdateAccountingEmployeeResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public UpdateAccountingEmployeeResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public UpdateAccountingEmployeeResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public UpdateAccountingEmployeeResponse withData(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public UpdateAccountingEmployeeResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public UpdateAccountingEmployeeResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAccountingEmployeeResponse other = (UpdateAccountingEmployeeResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + raw); + } + + @Override + public String toString() { + return Utils.toString(UpdateAccountingEmployeeResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private UnifiedId data; + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public Builder data(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public UpdateAccountingEmployeeResponse build() { + + return new UpdateAccountingEmployeeResponse( + statusCode, status, service, + resource, operation, data, + raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/UpdateExpenseCategoryResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateExpenseCategoryResponse.java new file mode 100644 index 000000000..7bec6a150 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/UpdateExpenseCategoryResponse.java @@ -0,0 +1,388 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * UpdateExpenseCategoryResponse + * + *

Expense Categories + */ +public class UpdateExpenseCategoryResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonProperty("data") + private UnifiedId data; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public UpdateExpenseCategoryResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") UnifiedId data, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.raw = raw; + } + + public UpdateExpenseCategoryResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + UnifiedId data) { + this(statusCode, status, service, + resource, operation, data, + JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonIgnore + public UnifiedId data() { + return data; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public UpdateExpenseCategoryResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public UpdateExpenseCategoryResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public UpdateExpenseCategoryResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public UpdateExpenseCategoryResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public UpdateExpenseCategoryResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public UpdateExpenseCategoryResponse withData(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public UpdateExpenseCategoryResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public UpdateExpenseCategoryResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateExpenseCategoryResponse other = (UpdateExpenseCategoryResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + raw); + } + + @Override + public String toString() { + return Utils.toString(UpdateExpenseCategoryResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private UnifiedId data; + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public Builder data(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public UpdateExpenseCategoryResponse build() { + + return new UpdateExpenseCategoryResponse( + statusCode, status, service, + resource, operation, data, + raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/UpdateExpenseReportResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateExpenseReportResponse.java new file mode 100644 index 000000000..32f566d1c --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/UpdateExpenseReportResponse.java @@ -0,0 +1,388 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.Utils; +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 java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * UpdateExpenseReportResponse + * + *

Expense Reports + */ +public class UpdateExpenseReportResponse { + /** + * HTTP Response Status Code + */ + @JsonProperty("status_code") + private long statusCode; + + /** + * HTTP Response Status + */ + @JsonProperty("status") + private String status; + + /** + * Apideck ID of service provider + */ + @JsonProperty("service") + private String service; + + /** + * Unified API resource name + */ + @JsonProperty("resource") + private String resource; + + /** + * Operation performed + */ + @JsonProperty("operation") + private String operation; + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonProperty("data") + private UnifiedId data; + + /** + * Raw response from the integration when raw=true query param is provided + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("_raw") + private JsonNullable> raw; + + @JsonCreator + public UpdateExpenseReportResponse( + @JsonProperty("status_code") long statusCode, + @JsonProperty("status") String status, + @JsonProperty("service") String service, + @JsonProperty("resource") String resource, + @JsonProperty("operation") String operation, + @JsonProperty("data") UnifiedId data, + @JsonProperty("_raw") JsonNullable> raw) { + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(status, "status"); + Utils.checkNotNull(service, "service"); + Utils.checkNotNull(resource, "resource"); + Utils.checkNotNull(operation, "operation"); + Utils.checkNotNull(data, "data"); + Utils.checkNotNull(raw, "raw"); + this.statusCode = statusCode; + this.status = status; + this.service = service; + this.resource = resource; + this.operation = operation; + this.data = data; + this.raw = raw; + } + + public UpdateExpenseReportResponse( + long statusCode, + String status, + String service, + String resource, + String operation, + UnifiedId data) { + this(statusCode, status, service, + resource, operation, data, + JsonNullable.undefined()); + } + + /** + * HTTP Response Status Code + */ + @JsonIgnore + public long statusCode() { + return statusCode; + } + + /** + * HTTP Response Status + */ + @JsonIgnore + public String status() { + return status; + } + + /** + * Apideck ID of service provider + */ + @JsonIgnore + public String service() { + return service; + } + + /** + * Unified API resource name + */ + @JsonIgnore + public String resource() { + return resource; + } + + /** + * Operation performed + */ + @JsonIgnore + public String operation() { + return operation; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + @JsonIgnore + public UnifiedId data() { + return data; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> raw() { + return (JsonNullable>) raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP Response Status Code + */ + public UpdateExpenseReportResponse withStatusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * HTTP Response Status + */ + public UpdateExpenseReportResponse withStatus(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** + * Apideck ID of service provider + */ + public UpdateExpenseReportResponse withService(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + /** + * Unified API resource name + */ + public UpdateExpenseReportResponse withResource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + /** + * Operation performed + */ + public UpdateExpenseReportResponse withOperation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public UpdateExpenseReportResponse withData(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public UpdateExpenseReportResponse withRaw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public UpdateExpenseReportResponse withRaw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateExpenseReportResponse other = (UpdateExpenseReportResponse) o; + return + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.status, other.status) && + Utils.enhancedDeepEquals(this.service, other.service) && + Utils.enhancedDeepEquals(this.resource, other.resource) && + Utils.enhancedDeepEquals(this.operation, other.operation) && + Utils.enhancedDeepEquals(this.data, other.data) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + statusCode, status, service, + resource, operation, data, + raw); + } + + @Override + public String toString() { + return Utils.toString(UpdateExpenseReportResponse.class, + "statusCode", statusCode, + "status", status, + "service", service, + "resource", resource, + "operation", operation, + "data", data, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Long statusCode; + + private String status; + + private String service; + + private String resource; + + private String operation; + + private UnifiedId data; + + private JsonNullable> raw = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * HTTP Response Status Code + */ + public Builder statusCode(long statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + + /** + * HTTP Response Status + */ + public Builder status(String status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + + /** + * Apideck ID of service provider + */ + public Builder service(String service) { + Utils.checkNotNull(service, "service"); + this.service = service; + return this; + } + + + /** + * Unified API resource name + */ + public Builder resource(String resource) { + Utils.checkNotNull(resource, "resource"); + this.resource = resource; + return this; + } + + + /** + * Operation performed + */ + public Builder operation(String operation) { + Utils.checkNotNull(operation, "operation"); + this.operation = operation; + return this; + } + + + /** + * A object containing a unique identifier for the resource that was created, updated, or deleted. + */ + public Builder data(UnifiedId data) { + Utils.checkNotNull(data, "data"); + this.data = data; + return this; + } + + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(Map raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = JsonNullable.of(raw); + return this; + } + + /** + * Raw response from the integration when raw=true query param is provided + */ + public Builder raw(JsonNullable> raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public UpdateExpenseReportResponse build() { + + return new UpdateExpenseReportResponse( + statusCode, status, service, + resource, operation, data, + raw); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAddRequest.java new file mode 100644 index 000000000..5cfc26216 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAddRequest.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.AccountingEmployeeInput; +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + + +public class AccountingEmployeesAddRequest { + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + + @SpeakeasyMetadata("request:mediaType=application/json") + private AccountingEmployeeInput accountingEmployee; + + @JsonCreator + public AccountingEmployeesAddRequest( + Optional raw, + Optional consumerId, + Optional appId, + Optional serviceId, + AccountingEmployeeInput accountingEmployee) { + Utils.checkNotNull(raw, "raw"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(accountingEmployee, "accountingEmployee"); + this.raw = raw; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.accountingEmployee = accountingEmployee; + } + + public AccountingEmployeesAddRequest( + AccountingEmployeeInput accountingEmployee) { + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), accountingEmployee); + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + @JsonIgnore + public AccountingEmployeeInput accountingEmployee() { + return accountingEmployee; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingEmployeesAddRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingEmployeesAddRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingEmployeesAddRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingEmployeesAddRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingEmployeesAddRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingEmployeesAddRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingEmployeesAddRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingEmployeesAddRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + public AccountingEmployeesAddRequest withAccountingEmployee(AccountingEmployeeInput accountingEmployee) { + Utils.checkNotNull(accountingEmployee, "accountingEmployee"); + this.accountingEmployee = accountingEmployee; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesAddRequest other = (AccountingEmployeesAddRequest) o; + return + Utils.enhancedDeepEquals(this.raw, other.raw) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.accountingEmployee, other.accountingEmployee); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + raw, consumerId, appId, + serviceId, accountingEmployee); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesAddRequest.class, + "raw", raw, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "accountingEmployee", accountingEmployee); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional raw; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private AccountingEmployeeInput accountingEmployee; + + private Builder() { + // force use of static builder() method + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + public Builder accountingEmployee(AccountingEmployeeInput accountingEmployee) { + Utils.checkNotNull(accountingEmployee, "accountingEmployee"); + this.accountingEmployee = accountingEmployee; + return this; + } + + public AccountingEmployeesAddRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + + return new AccountingEmployeesAddRequest( + raw, consumerId, appId, + serviceId, accountingEmployee); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAddRequestBuilder.java new file mode 100644 index 000000000..e361c58c6 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAddRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingEmployeesAdd; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; + +public class AccountingEmployeesAddRequestBuilder { + + private AccountingEmployeesAddRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingEmployeesAddRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingEmployeesAddRequestBuilder request(AccountingEmployeesAddRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingEmployeesAddRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingEmployeesAddRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingEmployeesAddResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingEmployeesAdd.Sync(sdkConfiguration, options, _headers); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAddResponse.java new file mode 100644 index 000000000..a5234436a --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAddResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.CreateAccountingEmployeeResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingEmployeesAddResponse 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; + + /** + * Employees + */ + private Optional createAccountingEmployeeResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingEmployeesAddResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional createAccountingEmployeeResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(createAccountingEmployeeResponse, "createAccountingEmployeeResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.createAccountingEmployeeResponse = createAccountingEmployeeResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingEmployeesAddResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Employees + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createAccountingEmployeeResponse() { + return (Optional) createAccountingEmployeeResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingEmployeesAddResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingEmployeesAddResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingEmployeesAddResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Employees + */ + public AccountingEmployeesAddResponse withCreateAccountingEmployeeResponse(CreateAccountingEmployeeResponse createAccountingEmployeeResponse) { + Utils.checkNotNull(createAccountingEmployeeResponse, "createAccountingEmployeeResponse"); + this.createAccountingEmployeeResponse = Optional.ofNullable(createAccountingEmployeeResponse); + return this; + } + + + /** + * Employees + */ + public AccountingEmployeesAddResponse withCreateAccountingEmployeeResponse(Optional createAccountingEmployeeResponse) { + Utils.checkNotNull(createAccountingEmployeeResponse, "createAccountingEmployeeResponse"); + this.createAccountingEmployeeResponse = createAccountingEmployeeResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingEmployeesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingEmployeesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesAddResponse other = (AccountingEmployeesAddResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.createAccountingEmployeeResponse, other.createAccountingEmployeeResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + createAccountingEmployeeResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesAddResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "createAccountingEmployeeResponse", createAccountingEmployeeResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional createAccountingEmployeeResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Employees + */ + public Builder createAccountingEmployeeResponse(CreateAccountingEmployeeResponse createAccountingEmployeeResponse) { + Utils.checkNotNull(createAccountingEmployeeResponse, "createAccountingEmployeeResponse"); + this.createAccountingEmployeeResponse = Optional.ofNullable(createAccountingEmployeeResponse); + return this; + } + + /** + * Employees + */ + public Builder createAccountingEmployeeResponse(Optional createAccountingEmployeeResponse) { + Utils.checkNotNull(createAccountingEmployeeResponse, "createAccountingEmployeeResponse"); + this.createAccountingEmployeeResponse = createAccountingEmployeeResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingEmployeesAddResponse build() { + + return new AccountingEmployeesAddResponse( + contentType, statusCode, rawResponse, + createAccountingEmployeeResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAllRequest.java new file mode 100644 index 000000000..0aef1d127 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAllRequest.java @@ -0,0 +1,628 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.AccountingEmployeesFilter; +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Long; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingEmployeesAllRequest { + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=cursor") + private JsonNullable cursor; + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") + private Optional limit; + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=fields") + private JsonNullable fields; + + /** + * Apply filters + */ + @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") + private Optional filter; + + @JsonCreator + public AccountingEmployeesAllRequest( + Optional raw, + Optional consumerId, + Optional appId, + Optional serviceId, + JsonNullable cursor, + Optional limit, + JsonNullable fields, + Optional filter) { + Utils.checkNotNull(raw, "raw"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(cursor, "cursor"); + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(fields, "fields"); + Utils.checkNotNull(filter, "filter"); + this.raw = raw; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.cursor = cursor; + this.limit = limit; + this.fields = fields; + this.filter = filter; + } + + public AccountingEmployeesAllRequest() { + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), JsonNullable.undefined(), Optional.empty(), + JsonNullable.undefined(), Optional.empty()); + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + @JsonIgnore + public JsonNullable cursor() { + return cursor; + } + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + @JsonIgnore + public Optional limit() { + return limit; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + @JsonIgnore + public JsonNullable fields() { + return fields; + } + + /** + * Apply filters + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filter() { + return (Optional) filter; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingEmployeesAllRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingEmployeesAllRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingEmployeesAllRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingEmployeesAllRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingEmployeesAllRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingEmployeesAllRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingEmployeesAllRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingEmployeesAllRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + public AccountingEmployeesAllRequest withCursor(String cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = JsonNullable.of(cursor); + return this; + } + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + public AccountingEmployeesAllRequest withCursor(JsonNullable cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = cursor; + return this; + } + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + public AccountingEmployeesAllRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + public AccountingEmployeesAllRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public AccountingEmployeesAllRequest withFields(String fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = JsonNullable.of(fields); + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public AccountingEmployeesAllRequest withFields(JsonNullable fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = fields; + return this; + } + + /** + * Apply filters + */ + public AccountingEmployeesAllRequest withFilter(AccountingEmployeesFilter filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + + /** + * Apply filters + */ + public AccountingEmployeesAllRequest withFilter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesAllRequest other = (AccountingEmployeesAllRequest) o; + return + Utils.enhancedDeepEquals(this.raw, other.raw) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.cursor, other.cursor) && + Utils.enhancedDeepEquals(this.limit, other.limit) && + Utils.enhancedDeepEquals(this.fields, other.fields) && + Utils.enhancedDeepEquals(this.filter, other.filter); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + raw, consumerId, appId, + serviceId, cursor, limit, + fields, filter); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesAllRequest.class, + "raw", raw, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "cursor", cursor, + "limit", limit, + "fields", fields, + "filter", filter); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional raw; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private JsonNullable cursor = JsonNullable.undefined(); + + private Optional limit; + + private JsonNullable fields = JsonNullable.undefined(); + + private Optional filter = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + public Builder cursor(String cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = JsonNullable.of(cursor); + return this; + } + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + public Builder cursor(JsonNullable cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = cursor; + return this; + } + + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public Builder fields(String fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = JsonNullable.of(fields); + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public Builder fields(JsonNullable fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = fields; + return this; + } + + + /** + * Apply filters + */ + public Builder filter(AccountingEmployeesFilter filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + /** + * Apply filters + */ + public Builder filter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public AccountingEmployeesAllRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + + return new AccountingEmployeesAllRequest( + raw, consumerId, appId, + serviceId, cursor, limit, + fields, filter); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "20", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAllRequestBuilder.java new file mode 100644 index 000000000..c70c1608d --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAllRequestBuilder.java @@ -0,0 +1,104 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.utils.Utils.transform; +import static com.apideck.unify.utils.Utils.toStream; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingEmployeesAll; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.apideck.unify.utils.pagination.CursorTracker; +import com.apideck.unify.utils.pagination.Paginator; +import java.io.InputStream; +import java.lang.Iterable; +import java.lang.String; +import java.net.http.HttpResponse; +import java.util.Iterator; +import java.util.Optional; +import java.util.stream.Stream; + +public class AccountingEmployeesAllRequestBuilder { + + private AccountingEmployeesAllRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingEmployeesAllRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingEmployeesAllRequestBuilder request(AccountingEmployeesAllRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingEmployeesAllRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingEmployeesAllRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingEmployeesAllResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingEmployeesAll.Sync(sdkConfiguration, options, _headers); + + 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 (AccountingEmployeesAllResponse 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 AccountingEmployeesAll.Sync(sdkConfiguration, options, _headers); + Iterator> iterator = new Paginator<>( + request, + new CursorTracker<>("$.meta.cursors.next", String.class), + AccountingEmployeesAllRequest::withCursor, + nextRequest -> unchecked(() -> operation.doRequest(request)).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()); + } + +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAllResponse.java new file mode 100644 index 000000000..f9c2e0433 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesAllResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.GetAccountingEmployeesResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingEmployeesAllResponse 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; + + /** + * Employees + */ + private Optional getAccountingEmployeesResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingEmployeesAllResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional getAccountingEmployeesResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(getAccountingEmployeesResponse, "getAccountingEmployeesResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.getAccountingEmployeesResponse = getAccountingEmployeesResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingEmployeesAllResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Employees + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional getAccountingEmployeesResponse() { + return (Optional) getAccountingEmployeesResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingEmployeesAllResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingEmployeesAllResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingEmployeesAllResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Employees + */ + public AccountingEmployeesAllResponse withGetAccountingEmployeesResponse(GetAccountingEmployeesResponse getAccountingEmployeesResponse) { + Utils.checkNotNull(getAccountingEmployeesResponse, "getAccountingEmployeesResponse"); + this.getAccountingEmployeesResponse = Optional.ofNullable(getAccountingEmployeesResponse); + return this; + } + + + /** + * Employees + */ + public AccountingEmployeesAllResponse withGetAccountingEmployeesResponse(Optional getAccountingEmployeesResponse) { + Utils.checkNotNull(getAccountingEmployeesResponse, "getAccountingEmployeesResponse"); + this.getAccountingEmployeesResponse = getAccountingEmployeesResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingEmployeesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingEmployeesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesAllResponse other = (AccountingEmployeesAllResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getAccountingEmployeesResponse, other.getAccountingEmployeesResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + getAccountingEmployeesResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesAllResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "getAccountingEmployeesResponse", getAccountingEmployeesResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional getAccountingEmployeesResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Employees + */ + public Builder getAccountingEmployeesResponse(GetAccountingEmployeesResponse getAccountingEmployeesResponse) { + Utils.checkNotNull(getAccountingEmployeesResponse, "getAccountingEmployeesResponse"); + this.getAccountingEmployeesResponse = Optional.ofNullable(getAccountingEmployeesResponse); + return this; + } + + /** + * Employees + */ + public Builder getAccountingEmployeesResponse(Optional getAccountingEmployeesResponse) { + Utils.checkNotNull(getAccountingEmployeesResponse, "getAccountingEmployeesResponse"); + this.getAccountingEmployeesResponse = getAccountingEmployeesResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingEmployeesAllResponse build() { + + return new AccountingEmployeesAllResponse( + contentType, statusCode, rawResponse, + getAccountingEmployeesResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesDeleteRequest.java new file mode 100644 index 000000000..d619ddf0c --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesDeleteRequest.java @@ -0,0 +1,364 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + + +public class AccountingEmployeesDeleteRequest { + /** + * ID of the record you are acting upon. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + private String id; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + @JsonCreator + public AccountingEmployeesDeleteRequest( + String id, + Optional consumerId, + Optional appId, + Optional serviceId, + Optional raw) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(raw, "raw"); + this.id = id; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.raw = raw; + } + + public AccountingEmployeesDeleteRequest( + String id) { + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); + } + + /** + * ID of the record you are acting upon. + */ + @JsonIgnore + public String id() { + return id; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * ID of the record you are acting upon. + */ + public AccountingEmployeesDeleteRequest withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingEmployeesDeleteRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingEmployeesDeleteRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingEmployeesDeleteRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingEmployeesDeleteRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingEmployeesDeleteRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingEmployeesDeleteRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingEmployeesDeleteRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingEmployeesDeleteRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesDeleteRequest other = (AccountingEmployeesDeleteRequest) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, consumerId, appId, + serviceId, raw); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesDeleteRequest.class, + "id", id, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String id; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private Optional raw; + + private Builder() { + // force use of static builder() method + } + + + /** + * ID of the record you are acting upon. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public AccountingEmployeesDeleteRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + + return new AccountingEmployeesDeleteRequest( + id, consumerId, appId, + serviceId, raw); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesDeleteRequestBuilder.java new file mode 100644 index 000000000..7f1fe6904 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesDeleteRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingEmployeesDelete; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; + +public class AccountingEmployeesDeleteRequestBuilder { + + private AccountingEmployeesDeleteRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingEmployeesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingEmployeesDeleteRequestBuilder request(AccountingEmployeesDeleteRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingEmployeesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingEmployeesDeleteRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingEmployeesDeleteResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingEmployeesDelete.Sync(sdkConfiguration, options, _headers); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesDeleteResponse.java new file mode 100644 index 000000000..7c8e3f6fa --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesDeleteResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.DeleteAccountingEmployeeResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingEmployeesDeleteResponse 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; + + /** + * Employees + */ + private Optional deleteAccountingEmployeeResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingEmployeesDeleteResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deleteAccountingEmployeeResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deleteAccountingEmployeeResponse, "deleteAccountingEmployeeResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deleteAccountingEmployeeResponse = deleteAccountingEmployeeResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingEmployeesDeleteResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Employees + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deleteAccountingEmployeeResponse() { + return (Optional) deleteAccountingEmployeeResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingEmployeesDeleteResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingEmployeesDeleteResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingEmployeesDeleteResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Employees + */ + public AccountingEmployeesDeleteResponse withDeleteAccountingEmployeeResponse(DeleteAccountingEmployeeResponse deleteAccountingEmployeeResponse) { + Utils.checkNotNull(deleteAccountingEmployeeResponse, "deleteAccountingEmployeeResponse"); + this.deleteAccountingEmployeeResponse = Optional.ofNullable(deleteAccountingEmployeeResponse); + return this; + } + + + /** + * Employees + */ + public AccountingEmployeesDeleteResponse withDeleteAccountingEmployeeResponse(Optional deleteAccountingEmployeeResponse) { + Utils.checkNotNull(deleteAccountingEmployeeResponse, "deleteAccountingEmployeeResponse"); + this.deleteAccountingEmployeeResponse = deleteAccountingEmployeeResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingEmployeesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingEmployeesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesDeleteResponse other = (AccountingEmployeesDeleteResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.deleteAccountingEmployeeResponse, other.deleteAccountingEmployeeResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + deleteAccountingEmployeeResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesDeleteResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deleteAccountingEmployeeResponse", deleteAccountingEmployeeResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deleteAccountingEmployeeResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Employees + */ + public Builder deleteAccountingEmployeeResponse(DeleteAccountingEmployeeResponse deleteAccountingEmployeeResponse) { + Utils.checkNotNull(deleteAccountingEmployeeResponse, "deleteAccountingEmployeeResponse"); + this.deleteAccountingEmployeeResponse = Optional.ofNullable(deleteAccountingEmployeeResponse); + return this; + } + + /** + * Employees + */ + public Builder deleteAccountingEmployeeResponse(Optional deleteAccountingEmployeeResponse) { + Utils.checkNotNull(deleteAccountingEmployeeResponse, "deleteAccountingEmployeeResponse"); + this.deleteAccountingEmployeeResponse = deleteAccountingEmployeeResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingEmployeesDeleteResponse build() { + + return new AccountingEmployeesDeleteResponse( + contentType, statusCode, rawResponse, + deleteAccountingEmployeeResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesOneRequest.java new file mode 100644 index 000000000..be80203f6 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesOneRequest.java @@ -0,0 +1,471 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingEmployeesOneRequest { + /** + * ID of the record you are acting upon. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + private String id; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=fields") + private JsonNullable fields; + + @JsonCreator + public AccountingEmployeesOneRequest( + String id, + Optional consumerId, + Optional appId, + Optional serviceId, + Optional raw, + JsonNullable fields) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(raw, "raw"); + Utils.checkNotNull(fields, "fields"); + this.id = id; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.raw = raw; + this.fields = fields; + } + + public AccountingEmployeesOneRequest( + String id) { + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), JsonNullable.undefined()); + } + + /** + * ID of the record you are acting upon. + */ + @JsonIgnore + public String id() { + return id; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + @JsonIgnore + public JsonNullable fields() { + return fields; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * ID of the record you are acting upon. + */ + public AccountingEmployeesOneRequest withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingEmployeesOneRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingEmployeesOneRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingEmployeesOneRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingEmployeesOneRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingEmployeesOneRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingEmployeesOneRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingEmployeesOneRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingEmployeesOneRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public AccountingEmployeesOneRequest withFields(String fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = JsonNullable.of(fields); + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public AccountingEmployeesOneRequest withFields(JsonNullable fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = fields; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesOneRequest other = (AccountingEmployeesOneRequest) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.raw, other.raw) && + Utils.enhancedDeepEquals(this.fields, other.fields); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, consumerId, appId, + serviceId, raw, fields); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesOneRequest.class, + "id", id, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "raw", raw, + "fields", fields); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String id; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private Optional raw; + + private JsonNullable fields = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * ID of the record you are acting upon. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public Builder fields(String fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = JsonNullable.of(fields); + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public Builder fields(JsonNullable fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = fields; + return this; + } + + public AccountingEmployeesOneRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + + return new AccountingEmployeesOneRequest( + id, consumerId, appId, + serviceId, raw, fields); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesOneRequestBuilder.java new file mode 100644 index 000000000..ab2f513ef --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesOneRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingEmployeesOne; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; + +public class AccountingEmployeesOneRequestBuilder { + + private AccountingEmployeesOneRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingEmployeesOneRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingEmployeesOneRequestBuilder request(AccountingEmployeesOneRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingEmployeesOneRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingEmployeesOneRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingEmployeesOneResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingEmployeesOne.Sync(sdkConfiguration, options, _headers); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesOneResponse.java new file mode 100644 index 000000000..b935384bb --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesOneResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.GetAccountingEmployeeResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingEmployeesOneResponse 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; + + /** + * Employees + */ + private Optional getAccountingEmployeeResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingEmployeesOneResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional getAccountingEmployeeResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(getAccountingEmployeeResponse, "getAccountingEmployeeResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.getAccountingEmployeeResponse = getAccountingEmployeeResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingEmployeesOneResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Employees + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional getAccountingEmployeeResponse() { + return (Optional) getAccountingEmployeeResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingEmployeesOneResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingEmployeesOneResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingEmployeesOneResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Employees + */ + public AccountingEmployeesOneResponse withGetAccountingEmployeeResponse(GetAccountingEmployeeResponse getAccountingEmployeeResponse) { + Utils.checkNotNull(getAccountingEmployeeResponse, "getAccountingEmployeeResponse"); + this.getAccountingEmployeeResponse = Optional.ofNullable(getAccountingEmployeeResponse); + return this; + } + + + /** + * Employees + */ + public AccountingEmployeesOneResponse withGetAccountingEmployeeResponse(Optional getAccountingEmployeeResponse) { + Utils.checkNotNull(getAccountingEmployeeResponse, "getAccountingEmployeeResponse"); + this.getAccountingEmployeeResponse = getAccountingEmployeeResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingEmployeesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingEmployeesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesOneResponse other = (AccountingEmployeesOneResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getAccountingEmployeeResponse, other.getAccountingEmployeeResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + getAccountingEmployeeResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesOneResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "getAccountingEmployeeResponse", getAccountingEmployeeResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional getAccountingEmployeeResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Employees + */ + public Builder getAccountingEmployeeResponse(GetAccountingEmployeeResponse getAccountingEmployeeResponse) { + Utils.checkNotNull(getAccountingEmployeeResponse, "getAccountingEmployeeResponse"); + this.getAccountingEmployeeResponse = Optional.ofNullable(getAccountingEmployeeResponse); + return this; + } + + /** + * Employees + */ + public Builder getAccountingEmployeeResponse(Optional getAccountingEmployeeResponse) { + Utils.checkNotNull(getAccountingEmployeeResponse, "getAccountingEmployeeResponse"); + this.getAccountingEmployeeResponse = getAccountingEmployeeResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingEmployeesOneResponse build() { + + return new AccountingEmployeesOneResponse( + contentType, statusCode, rawResponse, + getAccountingEmployeeResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesUpdateRequest.java new file mode 100644 index 000000000..a07b97dec --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesUpdateRequest.java @@ -0,0 +1,395 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.AccountingEmployeeInput; +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + + +public class AccountingEmployeesUpdateRequest { + /** + * ID of the record you are acting upon. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + private String id; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + + @SpeakeasyMetadata("request:mediaType=application/json") + private AccountingEmployeeInput accountingEmployee; + + @JsonCreator + public AccountingEmployeesUpdateRequest( + String id, + Optional consumerId, + Optional appId, + Optional serviceId, + Optional raw, + AccountingEmployeeInput accountingEmployee) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(raw, "raw"); + Utils.checkNotNull(accountingEmployee, "accountingEmployee"); + this.id = id; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.raw = raw; + this.accountingEmployee = accountingEmployee; + } + + public AccountingEmployeesUpdateRequest( + String id, + AccountingEmployeeInput accountingEmployee) { + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), accountingEmployee); + } + + /** + * ID of the record you are acting upon. + */ + @JsonIgnore + public String id() { + return id; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + @JsonIgnore + public AccountingEmployeeInput accountingEmployee() { + return accountingEmployee; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * ID of the record you are acting upon. + */ + public AccountingEmployeesUpdateRequest withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingEmployeesUpdateRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingEmployeesUpdateRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingEmployeesUpdateRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingEmployeesUpdateRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingEmployeesUpdateRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingEmployeesUpdateRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingEmployeesUpdateRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingEmployeesUpdateRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public AccountingEmployeesUpdateRequest withAccountingEmployee(AccountingEmployeeInput accountingEmployee) { + Utils.checkNotNull(accountingEmployee, "accountingEmployee"); + this.accountingEmployee = accountingEmployee; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesUpdateRequest other = (AccountingEmployeesUpdateRequest) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.raw, other.raw) && + Utils.enhancedDeepEquals(this.accountingEmployee, other.accountingEmployee); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, consumerId, appId, + serviceId, raw, accountingEmployee); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesUpdateRequest.class, + "id", id, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "raw", raw, + "accountingEmployee", accountingEmployee); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String id; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private Optional raw; + + private AccountingEmployeeInput accountingEmployee; + + private Builder() { + // force use of static builder() method + } + + + /** + * ID of the record you are acting upon. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + + public Builder accountingEmployee(AccountingEmployeeInput accountingEmployee) { + Utils.checkNotNull(accountingEmployee, "accountingEmployee"); + this.accountingEmployee = accountingEmployee; + return this; + } + + public AccountingEmployeesUpdateRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + + return new AccountingEmployeesUpdateRequest( + id, consumerId, appId, + serviceId, raw, accountingEmployee); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesUpdateRequestBuilder.java new file mode 100644 index 000000000..09bb81233 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesUpdateRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingEmployeesUpdate; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; + +public class AccountingEmployeesUpdateRequestBuilder { + + private AccountingEmployeesUpdateRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingEmployeesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingEmployeesUpdateRequestBuilder request(AccountingEmployeesUpdateRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingEmployeesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingEmployeesUpdateRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingEmployeesUpdateResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingEmployeesUpdate.Sync(sdkConfiguration, options, _headers); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesUpdateResponse.java new file mode 100644 index 000000000..82e84f4e7 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingEmployeesUpdateResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.components.UpdateAccountingEmployeeResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingEmployeesUpdateResponse 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; + + /** + * Employees + */ + private Optional updateAccountingEmployeeResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingEmployeesUpdateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional updateAccountingEmployeeResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(updateAccountingEmployeeResponse, "updateAccountingEmployeeResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.updateAccountingEmployeeResponse = updateAccountingEmployeeResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingEmployeesUpdateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Employees + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updateAccountingEmployeeResponse() { + return (Optional) updateAccountingEmployeeResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingEmployeesUpdateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingEmployeesUpdateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingEmployeesUpdateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Employees + */ + public AccountingEmployeesUpdateResponse withUpdateAccountingEmployeeResponse(UpdateAccountingEmployeeResponse updateAccountingEmployeeResponse) { + Utils.checkNotNull(updateAccountingEmployeeResponse, "updateAccountingEmployeeResponse"); + this.updateAccountingEmployeeResponse = Optional.ofNullable(updateAccountingEmployeeResponse); + return this; + } + + + /** + * Employees + */ + public AccountingEmployeesUpdateResponse withUpdateAccountingEmployeeResponse(Optional updateAccountingEmployeeResponse) { + Utils.checkNotNull(updateAccountingEmployeeResponse, "updateAccountingEmployeeResponse"); + this.updateAccountingEmployeeResponse = updateAccountingEmployeeResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingEmployeesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingEmployeesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesUpdateResponse other = (AccountingEmployeesUpdateResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.updateAccountingEmployeeResponse, other.updateAccountingEmployeeResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + updateAccountingEmployeeResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesUpdateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "updateAccountingEmployeeResponse", updateAccountingEmployeeResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional updateAccountingEmployeeResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Employees + */ + public Builder updateAccountingEmployeeResponse(UpdateAccountingEmployeeResponse updateAccountingEmployeeResponse) { + Utils.checkNotNull(updateAccountingEmployeeResponse, "updateAccountingEmployeeResponse"); + this.updateAccountingEmployeeResponse = Optional.ofNullable(updateAccountingEmployeeResponse); + return this; + } + + /** + * Employees + */ + public Builder updateAccountingEmployeeResponse(Optional updateAccountingEmployeeResponse) { + Utils.checkNotNull(updateAccountingEmployeeResponse, "updateAccountingEmployeeResponse"); + this.updateAccountingEmployeeResponse = updateAccountingEmployeeResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingEmployeesUpdateResponse build() { + + return new AccountingEmployeesUpdateResponse( + contentType, statusCode, rawResponse, + updateAccountingEmployeeResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAddRequest.java new file mode 100644 index 000000000..ea2aa7dd7 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAddRequest.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.ExpenseCategoryInput; +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + + +public class AccountingExpenseCategoriesAddRequest { + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + + @SpeakeasyMetadata("request:mediaType=application/json") + private ExpenseCategoryInput expenseCategory; + + @JsonCreator + public AccountingExpenseCategoriesAddRequest( + Optional raw, + Optional consumerId, + Optional appId, + Optional serviceId, + ExpenseCategoryInput expenseCategory) { + Utils.checkNotNull(raw, "raw"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(expenseCategory, "expenseCategory"); + this.raw = raw; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.expenseCategory = expenseCategory; + } + + public AccountingExpenseCategoriesAddRequest( + ExpenseCategoryInput expenseCategory) { + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), expenseCategory); + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + @JsonIgnore + public ExpenseCategoryInput expenseCategory() { + return expenseCategory; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseCategoriesAddRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseCategoriesAddRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseCategoriesAddRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseCategoriesAddRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingExpenseCategoriesAddRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingExpenseCategoriesAddRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseCategoriesAddRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseCategoriesAddRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + public AccountingExpenseCategoriesAddRequest withExpenseCategory(ExpenseCategoryInput expenseCategory) { + Utils.checkNotNull(expenseCategory, "expenseCategory"); + this.expenseCategory = expenseCategory; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesAddRequest other = (AccountingExpenseCategoriesAddRequest) o; + return + Utils.enhancedDeepEquals(this.raw, other.raw) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.expenseCategory, other.expenseCategory); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + raw, consumerId, appId, + serviceId, expenseCategory); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesAddRequest.class, + "raw", raw, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "expenseCategory", expenseCategory); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional raw; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private ExpenseCategoryInput expenseCategory; + + private Builder() { + // force use of static builder() method + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + public Builder expenseCategory(ExpenseCategoryInput expenseCategory) { + Utils.checkNotNull(expenseCategory, "expenseCategory"); + this.expenseCategory = expenseCategory; + return this; + } + + public AccountingExpenseCategoriesAddRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + + return new AccountingExpenseCategoriesAddRequest( + raw, consumerId, appId, + serviceId, expenseCategory); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAddRequestBuilder.java new file mode 100644 index 000000000..caaf64ff5 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAddRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingExpenseCategoriesAdd; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; + +public class AccountingExpenseCategoriesAddRequestBuilder { + + private AccountingExpenseCategoriesAddRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseCategoriesAddRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseCategoriesAddRequestBuilder request(AccountingExpenseCategoriesAddRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseCategoriesAddRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseCategoriesAddRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingExpenseCategoriesAddResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingExpenseCategoriesAdd.Sync(sdkConfiguration, options, _headers); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAddResponse.java new file mode 100644 index 000000000..ba447d788 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAddResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.CreateExpenseCategoryResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseCategoriesAddResponse 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; + + /** + * Expense Categories + */ + private Optional createExpenseCategoryResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseCategoriesAddResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional createExpenseCategoryResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(createExpenseCategoryResponse, "createExpenseCategoryResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.createExpenseCategoryResponse = createExpenseCategoryResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseCategoriesAddResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Categories + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createExpenseCategoryResponse() { + return (Optional) createExpenseCategoryResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseCategoriesAddResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseCategoriesAddResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseCategoriesAddResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesAddResponse withCreateExpenseCategoryResponse(CreateExpenseCategoryResponse createExpenseCategoryResponse) { + Utils.checkNotNull(createExpenseCategoryResponse, "createExpenseCategoryResponse"); + this.createExpenseCategoryResponse = Optional.ofNullable(createExpenseCategoryResponse); + return this; + } + + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesAddResponse withCreateExpenseCategoryResponse(Optional createExpenseCategoryResponse) { + Utils.checkNotNull(createExpenseCategoryResponse, "createExpenseCategoryResponse"); + this.createExpenseCategoryResponse = createExpenseCategoryResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesAddResponse other = (AccountingExpenseCategoriesAddResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.createExpenseCategoryResponse, other.createExpenseCategoryResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + createExpenseCategoryResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesAddResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "createExpenseCategoryResponse", createExpenseCategoryResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional createExpenseCategoryResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Categories + */ + public Builder createExpenseCategoryResponse(CreateExpenseCategoryResponse createExpenseCategoryResponse) { + Utils.checkNotNull(createExpenseCategoryResponse, "createExpenseCategoryResponse"); + this.createExpenseCategoryResponse = Optional.ofNullable(createExpenseCategoryResponse); + return this; + } + + /** + * Expense Categories + */ + public Builder createExpenseCategoryResponse(Optional createExpenseCategoryResponse) { + Utils.checkNotNull(createExpenseCategoryResponse, "createExpenseCategoryResponse"); + this.createExpenseCategoryResponse = createExpenseCategoryResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseCategoriesAddResponse build() { + + return new AccountingExpenseCategoriesAddResponse( + contentType, statusCode, rawResponse, + createExpenseCategoryResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAllRequest.java new file mode 100644 index 000000000..452f8f69f --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAllRequest.java @@ -0,0 +1,628 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.ExpenseCategoriesFilter; +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Long; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingExpenseCategoriesAllRequest { + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=cursor") + private JsonNullable cursor; + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") + private Optional limit; + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=fields") + private JsonNullable fields; + + /** + * Apply filters + */ + @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") + private Optional filter; + + @JsonCreator + public AccountingExpenseCategoriesAllRequest( + Optional raw, + Optional consumerId, + Optional appId, + Optional serviceId, + JsonNullable cursor, + Optional limit, + JsonNullable fields, + Optional filter) { + Utils.checkNotNull(raw, "raw"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(cursor, "cursor"); + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(fields, "fields"); + Utils.checkNotNull(filter, "filter"); + this.raw = raw; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.cursor = cursor; + this.limit = limit; + this.fields = fields; + this.filter = filter; + } + + public AccountingExpenseCategoriesAllRequest() { + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), JsonNullable.undefined(), Optional.empty(), + JsonNullable.undefined(), Optional.empty()); + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + @JsonIgnore + public JsonNullable cursor() { + return cursor; + } + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + @JsonIgnore + public Optional limit() { + return limit; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + @JsonIgnore + public JsonNullable fields() { + return fields; + } + + /** + * Apply filters + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filter() { + return (Optional) filter; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseCategoriesAllRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseCategoriesAllRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseCategoriesAllRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseCategoriesAllRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingExpenseCategoriesAllRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingExpenseCategoriesAllRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseCategoriesAllRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseCategoriesAllRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + public AccountingExpenseCategoriesAllRequest withCursor(String cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = JsonNullable.of(cursor); + return this; + } + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + public AccountingExpenseCategoriesAllRequest withCursor(JsonNullable cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = cursor; + return this; + } + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + public AccountingExpenseCategoriesAllRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + public AccountingExpenseCategoriesAllRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public AccountingExpenseCategoriesAllRequest withFields(String fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = JsonNullable.of(fields); + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public AccountingExpenseCategoriesAllRequest withFields(JsonNullable fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = fields; + return this; + } + + /** + * Apply filters + */ + public AccountingExpenseCategoriesAllRequest withFilter(ExpenseCategoriesFilter filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + + /** + * Apply filters + */ + public AccountingExpenseCategoriesAllRequest withFilter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesAllRequest other = (AccountingExpenseCategoriesAllRequest) o; + return + Utils.enhancedDeepEquals(this.raw, other.raw) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.cursor, other.cursor) && + Utils.enhancedDeepEquals(this.limit, other.limit) && + Utils.enhancedDeepEquals(this.fields, other.fields) && + Utils.enhancedDeepEquals(this.filter, other.filter); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + raw, consumerId, appId, + serviceId, cursor, limit, + fields, filter); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesAllRequest.class, + "raw", raw, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "cursor", cursor, + "limit", limit, + "fields", fields, + "filter", filter); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional raw; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private JsonNullable cursor = JsonNullable.undefined(); + + private Optional limit; + + private JsonNullable fields = JsonNullable.undefined(); + + private Optional filter = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + public Builder cursor(String cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = JsonNullable.of(cursor); + return this; + } + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + public Builder cursor(JsonNullable cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = cursor; + return this; + } + + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public Builder fields(String fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = JsonNullable.of(fields); + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public Builder fields(JsonNullable fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = fields; + return this; + } + + + /** + * Apply filters + */ + public Builder filter(ExpenseCategoriesFilter filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + /** + * Apply filters + */ + public Builder filter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public AccountingExpenseCategoriesAllRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + + return new AccountingExpenseCategoriesAllRequest( + raw, consumerId, appId, + serviceId, cursor, limit, + fields, filter); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "20", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAllRequestBuilder.java new file mode 100644 index 000000000..fb51341e1 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAllRequestBuilder.java @@ -0,0 +1,104 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.utils.Utils.transform; +import static com.apideck.unify.utils.Utils.toStream; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingExpenseCategoriesAll; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.apideck.unify.utils.pagination.CursorTracker; +import com.apideck.unify.utils.pagination.Paginator; +import java.io.InputStream; +import java.lang.Iterable; +import java.lang.String; +import java.net.http.HttpResponse; +import java.util.Iterator; +import java.util.Optional; +import java.util.stream.Stream; + +public class AccountingExpenseCategoriesAllRequestBuilder { + + private AccountingExpenseCategoriesAllRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseCategoriesAllRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseCategoriesAllRequestBuilder request(AccountingExpenseCategoriesAllRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseCategoriesAllRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseCategoriesAllRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingExpenseCategoriesAllResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingExpenseCategoriesAll.Sync(sdkConfiguration, options, _headers); + + 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 (AccountingExpenseCategoriesAllResponse 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 AccountingExpenseCategoriesAll.Sync(sdkConfiguration, options, _headers); + Iterator> iterator = new Paginator<>( + request, + new CursorTracker<>("$.meta.cursors.next", String.class), + AccountingExpenseCategoriesAllRequest::withCursor, + nextRequest -> unchecked(() -> operation.doRequest(request)).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()); + } + +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAllResponse.java new file mode 100644 index 000000000..d12088074 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesAllResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.GetExpenseCategoriesResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseCategoriesAllResponse 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; + + /** + * Expense Categories + */ + private Optional getExpenseCategoriesResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseCategoriesAllResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional getExpenseCategoriesResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(getExpenseCategoriesResponse, "getExpenseCategoriesResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.getExpenseCategoriesResponse = getExpenseCategoriesResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseCategoriesAllResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Categories + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional getExpenseCategoriesResponse() { + return (Optional) getExpenseCategoriesResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseCategoriesAllResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseCategoriesAllResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseCategoriesAllResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesAllResponse withGetExpenseCategoriesResponse(GetExpenseCategoriesResponse getExpenseCategoriesResponse) { + Utils.checkNotNull(getExpenseCategoriesResponse, "getExpenseCategoriesResponse"); + this.getExpenseCategoriesResponse = Optional.ofNullable(getExpenseCategoriesResponse); + return this; + } + + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesAllResponse withGetExpenseCategoriesResponse(Optional getExpenseCategoriesResponse) { + Utils.checkNotNull(getExpenseCategoriesResponse, "getExpenseCategoriesResponse"); + this.getExpenseCategoriesResponse = getExpenseCategoriesResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesAllResponse other = (AccountingExpenseCategoriesAllResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getExpenseCategoriesResponse, other.getExpenseCategoriesResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + getExpenseCategoriesResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesAllResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "getExpenseCategoriesResponse", getExpenseCategoriesResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional getExpenseCategoriesResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Categories + */ + public Builder getExpenseCategoriesResponse(GetExpenseCategoriesResponse getExpenseCategoriesResponse) { + Utils.checkNotNull(getExpenseCategoriesResponse, "getExpenseCategoriesResponse"); + this.getExpenseCategoriesResponse = Optional.ofNullable(getExpenseCategoriesResponse); + return this; + } + + /** + * Expense Categories + */ + public Builder getExpenseCategoriesResponse(Optional getExpenseCategoriesResponse) { + Utils.checkNotNull(getExpenseCategoriesResponse, "getExpenseCategoriesResponse"); + this.getExpenseCategoriesResponse = getExpenseCategoriesResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseCategoriesAllResponse build() { + + return new AccountingExpenseCategoriesAllResponse( + contentType, statusCode, rawResponse, + getExpenseCategoriesResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesDeleteRequest.java new file mode 100644 index 000000000..e428da313 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesDeleteRequest.java @@ -0,0 +1,364 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + + +public class AccountingExpenseCategoriesDeleteRequest { + /** + * ID of the record you are acting upon. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + private String id; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + @JsonCreator + public AccountingExpenseCategoriesDeleteRequest( + String id, + Optional consumerId, + Optional appId, + Optional serviceId, + Optional raw) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(raw, "raw"); + this.id = id; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.raw = raw; + } + + public AccountingExpenseCategoriesDeleteRequest( + String id) { + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); + } + + /** + * ID of the record you are acting upon. + */ + @JsonIgnore + public String id() { + return id; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * ID of the record you are acting upon. + */ + public AccountingExpenseCategoriesDeleteRequest withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseCategoriesDeleteRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseCategoriesDeleteRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingExpenseCategoriesDeleteRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingExpenseCategoriesDeleteRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseCategoriesDeleteRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseCategoriesDeleteRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseCategoriesDeleteRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseCategoriesDeleteRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesDeleteRequest other = (AccountingExpenseCategoriesDeleteRequest) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, consumerId, appId, + serviceId, raw); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesDeleteRequest.class, + "id", id, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String id; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private Optional raw; + + private Builder() { + // force use of static builder() method + } + + + /** + * ID of the record you are acting upon. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public AccountingExpenseCategoriesDeleteRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + + return new AccountingExpenseCategoriesDeleteRequest( + id, consumerId, appId, + serviceId, raw); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesDeleteRequestBuilder.java new file mode 100644 index 000000000..0f1ce63a3 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesDeleteRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingExpenseCategoriesDelete; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; + +public class AccountingExpenseCategoriesDeleteRequestBuilder { + + private AccountingExpenseCategoriesDeleteRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseCategoriesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseCategoriesDeleteRequestBuilder request(AccountingExpenseCategoriesDeleteRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseCategoriesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseCategoriesDeleteRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingExpenseCategoriesDeleteResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingExpenseCategoriesDelete.Sync(sdkConfiguration, options, _headers); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesDeleteResponse.java new file mode 100644 index 000000000..946dbe1f3 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesDeleteResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.DeleteExpenseCategoryResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseCategoriesDeleteResponse 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; + + /** + * Expense Categories + */ + private Optional deleteExpenseCategoryResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseCategoriesDeleteResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deleteExpenseCategoryResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deleteExpenseCategoryResponse, "deleteExpenseCategoryResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deleteExpenseCategoryResponse = deleteExpenseCategoryResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseCategoriesDeleteResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Categories + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deleteExpenseCategoryResponse() { + return (Optional) deleteExpenseCategoryResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseCategoriesDeleteResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseCategoriesDeleteResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseCategoriesDeleteResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesDeleteResponse withDeleteExpenseCategoryResponse(DeleteExpenseCategoryResponse deleteExpenseCategoryResponse) { + Utils.checkNotNull(deleteExpenseCategoryResponse, "deleteExpenseCategoryResponse"); + this.deleteExpenseCategoryResponse = Optional.ofNullable(deleteExpenseCategoryResponse); + return this; + } + + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesDeleteResponse withDeleteExpenseCategoryResponse(Optional deleteExpenseCategoryResponse) { + Utils.checkNotNull(deleteExpenseCategoryResponse, "deleteExpenseCategoryResponse"); + this.deleteExpenseCategoryResponse = deleteExpenseCategoryResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesDeleteResponse other = (AccountingExpenseCategoriesDeleteResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.deleteExpenseCategoryResponse, other.deleteExpenseCategoryResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + deleteExpenseCategoryResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesDeleteResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deleteExpenseCategoryResponse", deleteExpenseCategoryResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deleteExpenseCategoryResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Categories + */ + public Builder deleteExpenseCategoryResponse(DeleteExpenseCategoryResponse deleteExpenseCategoryResponse) { + Utils.checkNotNull(deleteExpenseCategoryResponse, "deleteExpenseCategoryResponse"); + this.deleteExpenseCategoryResponse = Optional.ofNullable(deleteExpenseCategoryResponse); + return this; + } + + /** + * Expense Categories + */ + public Builder deleteExpenseCategoryResponse(Optional deleteExpenseCategoryResponse) { + Utils.checkNotNull(deleteExpenseCategoryResponse, "deleteExpenseCategoryResponse"); + this.deleteExpenseCategoryResponse = deleteExpenseCategoryResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseCategoriesDeleteResponse build() { + + return new AccountingExpenseCategoriesDeleteResponse( + contentType, statusCode, rawResponse, + deleteExpenseCategoryResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesOneRequest.java new file mode 100644 index 000000000..28a9cabe3 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesOneRequest.java @@ -0,0 +1,471 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingExpenseCategoriesOneRequest { + /** + * ID of the record you are acting upon. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + private String id; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=fields") + private JsonNullable fields; + + @JsonCreator + public AccountingExpenseCategoriesOneRequest( + String id, + Optional consumerId, + Optional appId, + Optional serviceId, + Optional raw, + JsonNullable fields) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(raw, "raw"); + Utils.checkNotNull(fields, "fields"); + this.id = id; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.raw = raw; + this.fields = fields; + } + + public AccountingExpenseCategoriesOneRequest( + String id) { + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), JsonNullable.undefined()); + } + + /** + * ID of the record you are acting upon. + */ + @JsonIgnore + public String id() { + return id; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + @JsonIgnore + public JsonNullable fields() { + return fields; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * ID of the record you are acting upon. + */ + public AccountingExpenseCategoriesOneRequest withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseCategoriesOneRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseCategoriesOneRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingExpenseCategoriesOneRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingExpenseCategoriesOneRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseCategoriesOneRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseCategoriesOneRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseCategoriesOneRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseCategoriesOneRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public AccountingExpenseCategoriesOneRequest withFields(String fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = JsonNullable.of(fields); + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public AccountingExpenseCategoriesOneRequest withFields(JsonNullable fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = fields; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesOneRequest other = (AccountingExpenseCategoriesOneRequest) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.raw, other.raw) && + Utils.enhancedDeepEquals(this.fields, other.fields); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, consumerId, appId, + serviceId, raw, fields); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesOneRequest.class, + "id", id, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "raw", raw, + "fields", fields); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String id; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private Optional raw; + + private JsonNullable fields = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * ID of the record you are acting upon. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public Builder fields(String fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = JsonNullable.of(fields); + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public Builder fields(JsonNullable fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = fields; + return this; + } + + public AccountingExpenseCategoriesOneRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + + return new AccountingExpenseCategoriesOneRequest( + id, consumerId, appId, + serviceId, raw, fields); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesOneRequestBuilder.java new file mode 100644 index 000000000..bf3efa4c3 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesOneRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingExpenseCategoriesOne; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; + +public class AccountingExpenseCategoriesOneRequestBuilder { + + private AccountingExpenseCategoriesOneRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseCategoriesOneRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseCategoriesOneRequestBuilder request(AccountingExpenseCategoriesOneRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseCategoriesOneRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseCategoriesOneRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingExpenseCategoriesOneResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingExpenseCategoriesOne.Sync(sdkConfiguration, options, _headers); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesOneResponse.java new file mode 100644 index 000000000..b3c956ded --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesOneResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.GetExpenseCategoryResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseCategoriesOneResponse 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; + + /** + * Expense Categories + */ + private Optional getExpenseCategoryResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseCategoriesOneResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional getExpenseCategoryResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(getExpenseCategoryResponse, "getExpenseCategoryResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.getExpenseCategoryResponse = getExpenseCategoryResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseCategoriesOneResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Categories + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional getExpenseCategoryResponse() { + return (Optional) getExpenseCategoryResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseCategoriesOneResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseCategoriesOneResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseCategoriesOneResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesOneResponse withGetExpenseCategoryResponse(GetExpenseCategoryResponse getExpenseCategoryResponse) { + Utils.checkNotNull(getExpenseCategoryResponse, "getExpenseCategoryResponse"); + this.getExpenseCategoryResponse = Optional.ofNullable(getExpenseCategoryResponse); + return this; + } + + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesOneResponse withGetExpenseCategoryResponse(Optional getExpenseCategoryResponse) { + Utils.checkNotNull(getExpenseCategoryResponse, "getExpenseCategoryResponse"); + this.getExpenseCategoryResponse = getExpenseCategoryResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesOneResponse other = (AccountingExpenseCategoriesOneResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getExpenseCategoryResponse, other.getExpenseCategoryResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + getExpenseCategoryResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesOneResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "getExpenseCategoryResponse", getExpenseCategoryResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional getExpenseCategoryResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Categories + */ + public Builder getExpenseCategoryResponse(GetExpenseCategoryResponse getExpenseCategoryResponse) { + Utils.checkNotNull(getExpenseCategoryResponse, "getExpenseCategoryResponse"); + this.getExpenseCategoryResponse = Optional.ofNullable(getExpenseCategoryResponse); + return this; + } + + /** + * Expense Categories + */ + public Builder getExpenseCategoryResponse(Optional getExpenseCategoryResponse) { + Utils.checkNotNull(getExpenseCategoryResponse, "getExpenseCategoryResponse"); + this.getExpenseCategoryResponse = getExpenseCategoryResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseCategoriesOneResponse build() { + + return new AccountingExpenseCategoriesOneResponse( + contentType, statusCode, rawResponse, + getExpenseCategoryResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesUpdateRequest.java new file mode 100644 index 000000000..9a3155ad2 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesUpdateRequest.java @@ -0,0 +1,395 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.ExpenseCategoryInput; +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + + +public class AccountingExpenseCategoriesUpdateRequest { + /** + * ID of the record you are acting upon. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + private String id; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + + @SpeakeasyMetadata("request:mediaType=application/json") + private ExpenseCategoryInput expenseCategory; + + @JsonCreator + public AccountingExpenseCategoriesUpdateRequest( + String id, + Optional consumerId, + Optional appId, + Optional serviceId, + Optional raw, + ExpenseCategoryInput expenseCategory) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(raw, "raw"); + Utils.checkNotNull(expenseCategory, "expenseCategory"); + this.id = id; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.raw = raw; + this.expenseCategory = expenseCategory; + } + + public AccountingExpenseCategoriesUpdateRequest( + String id, + ExpenseCategoryInput expenseCategory) { + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), expenseCategory); + } + + /** + * ID of the record you are acting upon. + */ + @JsonIgnore + public String id() { + return id; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + @JsonIgnore + public ExpenseCategoryInput expenseCategory() { + return expenseCategory; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * ID of the record you are acting upon. + */ + public AccountingExpenseCategoriesUpdateRequest withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseCategoriesUpdateRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseCategoriesUpdateRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingExpenseCategoriesUpdateRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingExpenseCategoriesUpdateRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseCategoriesUpdateRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseCategoriesUpdateRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseCategoriesUpdateRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseCategoriesUpdateRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public AccountingExpenseCategoriesUpdateRequest withExpenseCategory(ExpenseCategoryInput expenseCategory) { + Utils.checkNotNull(expenseCategory, "expenseCategory"); + this.expenseCategory = expenseCategory; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesUpdateRequest other = (AccountingExpenseCategoriesUpdateRequest) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.raw, other.raw) && + Utils.enhancedDeepEquals(this.expenseCategory, other.expenseCategory); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, consumerId, appId, + serviceId, raw, expenseCategory); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesUpdateRequest.class, + "id", id, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "raw", raw, + "expenseCategory", expenseCategory); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String id; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private Optional raw; + + private ExpenseCategoryInput expenseCategory; + + private Builder() { + // force use of static builder() method + } + + + /** + * ID of the record you are acting upon. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + + public Builder expenseCategory(ExpenseCategoryInput expenseCategory) { + Utils.checkNotNull(expenseCategory, "expenseCategory"); + this.expenseCategory = expenseCategory; + return this; + } + + public AccountingExpenseCategoriesUpdateRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + + return new AccountingExpenseCategoriesUpdateRequest( + id, consumerId, appId, + serviceId, raw, expenseCategory); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesUpdateRequestBuilder.java new file mode 100644 index 000000000..434b3f88d --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesUpdateRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingExpenseCategoriesUpdate; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; + +public class AccountingExpenseCategoriesUpdateRequestBuilder { + + private AccountingExpenseCategoriesUpdateRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseCategoriesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseCategoriesUpdateRequestBuilder request(AccountingExpenseCategoriesUpdateRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseCategoriesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseCategoriesUpdateRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingExpenseCategoriesUpdateResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingExpenseCategoriesUpdate.Sync(sdkConfiguration, options, _headers); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesUpdateResponse.java new file mode 100644 index 000000000..b39b27b7d --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseCategoriesUpdateResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.components.UpdateExpenseCategoryResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseCategoriesUpdateResponse 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; + + /** + * Expense Categories + */ + private Optional updateExpenseCategoryResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseCategoriesUpdateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional updateExpenseCategoryResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(updateExpenseCategoryResponse, "updateExpenseCategoryResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.updateExpenseCategoryResponse = updateExpenseCategoryResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseCategoriesUpdateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Categories + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updateExpenseCategoryResponse() { + return (Optional) updateExpenseCategoryResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseCategoriesUpdateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseCategoriesUpdateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseCategoriesUpdateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesUpdateResponse withUpdateExpenseCategoryResponse(UpdateExpenseCategoryResponse updateExpenseCategoryResponse) { + Utils.checkNotNull(updateExpenseCategoryResponse, "updateExpenseCategoryResponse"); + this.updateExpenseCategoryResponse = Optional.ofNullable(updateExpenseCategoryResponse); + return this; + } + + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesUpdateResponse withUpdateExpenseCategoryResponse(Optional updateExpenseCategoryResponse) { + Utils.checkNotNull(updateExpenseCategoryResponse, "updateExpenseCategoryResponse"); + this.updateExpenseCategoryResponse = updateExpenseCategoryResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesUpdateResponse other = (AccountingExpenseCategoriesUpdateResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.updateExpenseCategoryResponse, other.updateExpenseCategoryResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + updateExpenseCategoryResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesUpdateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "updateExpenseCategoryResponse", updateExpenseCategoryResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional updateExpenseCategoryResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Categories + */ + public Builder updateExpenseCategoryResponse(UpdateExpenseCategoryResponse updateExpenseCategoryResponse) { + Utils.checkNotNull(updateExpenseCategoryResponse, "updateExpenseCategoryResponse"); + this.updateExpenseCategoryResponse = Optional.ofNullable(updateExpenseCategoryResponse); + return this; + } + + /** + * Expense Categories + */ + public Builder updateExpenseCategoryResponse(Optional updateExpenseCategoryResponse) { + Utils.checkNotNull(updateExpenseCategoryResponse, "updateExpenseCategoryResponse"); + this.updateExpenseCategoryResponse = updateExpenseCategoryResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseCategoriesUpdateResponse build() { + + return new AccountingExpenseCategoriesUpdateResponse( + contentType, statusCode, rawResponse, + updateExpenseCategoryResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAddRequest.java new file mode 100644 index 000000000..9cf98593c --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAddRequest.java @@ -0,0 +1,354 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.ExpenseReportInput; +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + + +public class AccountingExpenseReportsAddRequest { + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + + @SpeakeasyMetadata("request:mediaType=application/json") + private ExpenseReportInput expenseReport; + + @JsonCreator + public AccountingExpenseReportsAddRequest( + Optional raw, + Optional consumerId, + Optional appId, + Optional serviceId, + ExpenseReportInput expenseReport) { + Utils.checkNotNull(raw, "raw"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(expenseReport, "expenseReport"); + this.raw = raw; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.expenseReport = expenseReport; + } + + public AccountingExpenseReportsAddRequest( + ExpenseReportInput expenseReport) { + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), expenseReport); + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + @JsonIgnore + public ExpenseReportInput expenseReport() { + return expenseReport; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseReportsAddRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseReportsAddRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseReportsAddRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseReportsAddRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingExpenseReportsAddRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingExpenseReportsAddRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseReportsAddRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseReportsAddRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + public AccountingExpenseReportsAddRequest withExpenseReport(ExpenseReportInput expenseReport) { + Utils.checkNotNull(expenseReport, "expenseReport"); + this.expenseReport = expenseReport; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsAddRequest other = (AccountingExpenseReportsAddRequest) o; + return + Utils.enhancedDeepEquals(this.raw, other.raw) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.expenseReport, other.expenseReport); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + raw, consumerId, appId, + serviceId, expenseReport); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsAddRequest.class, + "raw", raw, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "expenseReport", expenseReport); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional raw; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private ExpenseReportInput expenseReport; + + private Builder() { + // force use of static builder() method + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + public Builder expenseReport(ExpenseReportInput expenseReport) { + Utils.checkNotNull(expenseReport, "expenseReport"); + this.expenseReport = expenseReport; + return this; + } + + public AccountingExpenseReportsAddRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + + return new AccountingExpenseReportsAddRequest( + raw, consumerId, appId, + serviceId, expenseReport); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAddRequestBuilder.java new file mode 100644 index 000000000..bce985406 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAddRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingExpenseReportsAdd; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; + +public class AccountingExpenseReportsAddRequestBuilder { + + private AccountingExpenseReportsAddRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseReportsAddRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseReportsAddRequestBuilder request(AccountingExpenseReportsAddRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseReportsAddRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseReportsAddRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingExpenseReportsAddResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingExpenseReportsAdd.Sync(sdkConfiguration, options, _headers); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAddResponse.java new file mode 100644 index 000000000..2ffa86cfc --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAddResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.CreateExpenseReportResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseReportsAddResponse 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; + + /** + * Expense Reports + */ + private Optional createExpenseReportResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseReportsAddResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional createExpenseReportResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(createExpenseReportResponse, "createExpenseReportResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.createExpenseReportResponse = createExpenseReportResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseReportsAddResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Reports + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createExpenseReportResponse() { + return (Optional) createExpenseReportResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseReportsAddResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseReportsAddResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseReportsAddResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Reports + */ + public AccountingExpenseReportsAddResponse withCreateExpenseReportResponse(CreateExpenseReportResponse createExpenseReportResponse) { + Utils.checkNotNull(createExpenseReportResponse, "createExpenseReportResponse"); + this.createExpenseReportResponse = Optional.ofNullable(createExpenseReportResponse); + return this; + } + + + /** + * Expense Reports + */ + public AccountingExpenseReportsAddResponse withCreateExpenseReportResponse(Optional createExpenseReportResponse) { + Utils.checkNotNull(createExpenseReportResponse, "createExpenseReportResponse"); + this.createExpenseReportResponse = createExpenseReportResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseReportsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseReportsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsAddResponse other = (AccountingExpenseReportsAddResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.createExpenseReportResponse, other.createExpenseReportResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + createExpenseReportResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsAddResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "createExpenseReportResponse", createExpenseReportResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional createExpenseReportResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Reports + */ + public Builder createExpenseReportResponse(CreateExpenseReportResponse createExpenseReportResponse) { + Utils.checkNotNull(createExpenseReportResponse, "createExpenseReportResponse"); + this.createExpenseReportResponse = Optional.ofNullable(createExpenseReportResponse); + return this; + } + + /** + * Expense Reports + */ + public Builder createExpenseReportResponse(Optional createExpenseReportResponse) { + Utils.checkNotNull(createExpenseReportResponse, "createExpenseReportResponse"); + this.createExpenseReportResponse = createExpenseReportResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseReportsAddResponse build() { + + return new AccountingExpenseReportsAddResponse( + contentType, statusCode, rawResponse, + createExpenseReportResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAllRequest.java new file mode 100644 index 000000000..e526edc95 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAllRequest.java @@ -0,0 +1,628 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.ExpenseReportsFilter; +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Long; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingExpenseReportsAllRequest { + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=cursor") + private JsonNullable cursor; + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") + private Optional limit; + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=fields") + private JsonNullable fields; + + /** + * Apply filters + */ + @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") + private Optional filter; + + @JsonCreator + public AccountingExpenseReportsAllRequest( + Optional raw, + Optional consumerId, + Optional appId, + Optional serviceId, + JsonNullable cursor, + Optional limit, + JsonNullable fields, + Optional filter) { + Utils.checkNotNull(raw, "raw"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(cursor, "cursor"); + Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(fields, "fields"); + Utils.checkNotNull(filter, "filter"); + this.raw = raw; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.cursor = cursor; + this.limit = limit; + this.fields = fields; + this.filter = filter; + } + + public AccountingExpenseReportsAllRequest() { + this(Optional.empty(), Optional.empty(), Optional.empty(), + Optional.empty(), JsonNullable.undefined(), Optional.empty(), + JsonNullable.undefined(), Optional.empty()); + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + @JsonIgnore + public JsonNullable cursor() { + return cursor; + } + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + @JsonIgnore + public Optional limit() { + return limit; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + @JsonIgnore + public JsonNullable fields() { + return fields; + } + + /** + * Apply filters + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional filter() { + return (Optional) filter; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseReportsAllRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseReportsAllRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseReportsAllRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseReportsAllRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingExpenseReportsAllRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingExpenseReportsAllRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseReportsAllRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseReportsAllRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + public AccountingExpenseReportsAllRequest withCursor(String cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = JsonNullable.of(cursor); + return this; + } + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + public AccountingExpenseReportsAllRequest withCursor(JsonNullable cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = cursor; + return this; + } + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + public AccountingExpenseReportsAllRequest withLimit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + public AccountingExpenseReportsAllRequest withLimit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public AccountingExpenseReportsAllRequest withFields(String fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = JsonNullable.of(fields); + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public AccountingExpenseReportsAllRequest withFields(JsonNullable fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = fields; + return this; + } + + /** + * Apply filters + */ + public AccountingExpenseReportsAllRequest withFilter(ExpenseReportsFilter filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + + /** + * Apply filters + */ + public AccountingExpenseReportsAllRequest withFilter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsAllRequest other = (AccountingExpenseReportsAllRequest) o; + return + Utils.enhancedDeepEquals(this.raw, other.raw) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.cursor, other.cursor) && + Utils.enhancedDeepEquals(this.limit, other.limit) && + Utils.enhancedDeepEquals(this.fields, other.fields) && + Utils.enhancedDeepEquals(this.filter, other.filter); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + raw, consumerId, appId, + serviceId, cursor, limit, + fields, filter); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsAllRequest.class, + "raw", raw, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "cursor", cursor, + "limit", limit, + "fields", fields, + "filter", filter); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private Optional raw; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private JsonNullable cursor = JsonNullable.undefined(); + + private Optional limit; + + private JsonNullable fields = JsonNullable.undefined(); + + private Optional filter = Optional.empty(); + + private Builder() { + // force use of static builder() method + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + public Builder cursor(String cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = JsonNullable.of(cursor); + return this; + } + + /** + * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of + * the response. + */ + public Builder cursor(JsonNullable cursor) { + Utils.checkNotNull(cursor, "cursor"); + this.cursor = cursor; + return this; + } + + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + public Builder limit(long limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = Optional.ofNullable(limit); + return this; + } + + /** + * Number of results to return. Minimum 1, Maximum 200, Default 20 + */ + public Builder limit(Optional limit) { + Utils.checkNotNull(limit, "limit"); + this.limit = limit; + return this; + } + + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public Builder fields(String fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = JsonNullable.of(fields); + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public Builder fields(JsonNullable fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = fields; + return this; + } + + + /** + * Apply filters + */ + public Builder filter(ExpenseReportsFilter filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = Optional.ofNullable(filter); + return this; + } + + /** + * Apply filters + */ + public Builder filter(Optional filter) { + Utils.checkNotNull(filter, "filter"); + this.filter = filter; + return this; + } + + public AccountingExpenseReportsAllRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + if (limit == null) { + limit = _SINGLETON_VALUE_Limit.value(); + } + + return new AccountingExpenseReportsAllRequest( + raw, consumerId, appId, + serviceId, cursor, limit, + fields, filter); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + + private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + new LazySingletonValue<>( + "limit", + "20", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAllRequestBuilder.java new file mode 100644 index 000000000..b04dd2908 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAllRequestBuilder.java @@ -0,0 +1,104 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.utils.Utils.transform; +import static com.apideck.unify.utils.Utils.toStream; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingExpenseReportsAll; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.apideck.unify.utils.pagination.CursorTracker; +import com.apideck.unify.utils.pagination.Paginator; +import java.io.InputStream; +import java.lang.Iterable; +import java.lang.String; +import java.net.http.HttpResponse; +import java.util.Iterator; +import java.util.Optional; +import java.util.stream.Stream; + +public class AccountingExpenseReportsAllRequestBuilder { + + private AccountingExpenseReportsAllRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseReportsAllRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseReportsAllRequestBuilder request(AccountingExpenseReportsAllRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseReportsAllRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseReportsAllRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingExpenseReportsAllResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingExpenseReportsAll.Sync(sdkConfiguration, options, _headers); + + 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 (AccountingExpenseReportsAllResponse 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 AccountingExpenseReportsAll.Sync(sdkConfiguration, options, _headers); + Iterator> iterator = new Paginator<>( + request, + new CursorTracker<>("$.meta.cursors.next", String.class), + AccountingExpenseReportsAllRequest::withCursor, + nextRequest -> unchecked(() -> operation.doRequest(request)).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()); + } + +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAllResponse.java new file mode 100644 index 000000000..0f6606add --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsAllResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.GetExpenseReportsResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseReportsAllResponse 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; + + /** + * Expense Reports + */ + private Optional getExpenseReportsResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseReportsAllResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional getExpenseReportsResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(getExpenseReportsResponse, "getExpenseReportsResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.getExpenseReportsResponse = getExpenseReportsResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseReportsAllResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Reports + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional getExpenseReportsResponse() { + return (Optional) getExpenseReportsResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseReportsAllResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseReportsAllResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseReportsAllResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Reports + */ + public AccountingExpenseReportsAllResponse withGetExpenseReportsResponse(GetExpenseReportsResponse getExpenseReportsResponse) { + Utils.checkNotNull(getExpenseReportsResponse, "getExpenseReportsResponse"); + this.getExpenseReportsResponse = Optional.ofNullable(getExpenseReportsResponse); + return this; + } + + + /** + * Expense Reports + */ + public AccountingExpenseReportsAllResponse withGetExpenseReportsResponse(Optional getExpenseReportsResponse) { + Utils.checkNotNull(getExpenseReportsResponse, "getExpenseReportsResponse"); + this.getExpenseReportsResponse = getExpenseReportsResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseReportsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseReportsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsAllResponse other = (AccountingExpenseReportsAllResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getExpenseReportsResponse, other.getExpenseReportsResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + getExpenseReportsResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsAllResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "getExpenseReportsResponse", getExpenseReportsResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional getExpenseReportsResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Reports + */ + public Builder getExpenseReportsResponse(GetExpenseReportsResponse getExpenseReportsResponse) { + Utils.checkNotNull(getExpenseReportsResponse, "getExpenseReportsResponse"); + this.getExpenseReportsResponse = Optional.ofNullable(getExpenseReportsResponse); + return this; + } + + /** + * Expense Reports + */ + public Builder getExpenseReportsResponse(Optional getExpenseReportsResponse) { + Utils.checkNotNull(getExpenseReportsResponse, "getExpenseReportsResponse"); + this.getExpenseReportsResponse = getExpenseReportsResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseReportsAllResponse build() { + + return new AccountingExpenseReportsAllResponse( + contentType, statusCode, rawResponse, + getExpenseReportsResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsDeleteRequest.java new file mode 100644 index 000000000..14187b8c5 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsDeleteRequest.java @@ -0,0 +1,364 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + + +public class AccountingExpenseReportsDeleteRequest { + /** + * ID of the record you are acting upon. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + private String id; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + @JsonCreator + public AccountingExpenseReportsDeleteRequest( + String id, + Optional consumerId, + Optional appId, + Optional serviceId, + Optional raw) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(raw, "raw"); + this.id = id; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.raw = raw; + } + + public AccountingExpenseReportsDeleteRequest( + String id) { + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty()); + } + + /** + * ID of the record you are acting upon. + */ + @JsonIgnore + public String id() { + return id; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * ID of the record you are acting upon. + */ + public AccountingExpenseReportsDeleteRequest withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseReportsDeleteRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseReportsDeleteRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingExpenseReportsDeleteRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingExpenseReportsDeleteRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseReportsDeleteRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseReportsDeleteRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseReportsDeleteRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseReportsDeleteRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsDeleteRequest other = (AccountingExpenseReportsDeleteRequest) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.raw, other.raw); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, consumerId, appId, + serviceId, raw); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsDeleteRequest.class, + "id", id, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "raw", raw); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String id; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private Optional raw; + + private Builder() { + // force use of static builder() method + } + + + /** + * ID of the record you are acting upon. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public AccountingExpenseReportsDeleteRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + + return new AccountingExpenseReportsDeleteRequest( + id, consumerId, appId, + serviceId, raw); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsDeleteRequestBuilder.java new file mode 100644 index 000000000..efaa0cfbe --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsDeleteRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingExpenseReportsDelete; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; + +public class AccountingExpenseReportsDeleteRequestBuilder { + + private AccountingExpenseReportsDeleteRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseReportsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseReportsDeleteRequestBuilder request(AccountingExpenseReportsDeleteRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseReportsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseReportsDeleteRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingExpenseReportsDeleteResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingExpenseReportsDelete.Sync(sdkConfiguration, options, _headers); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsDeleteResponse.java new file mode 100644 index 000000000..00b2448c1 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsDeleteResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.DeleteExpenseReportResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseReportsDeleteResponse 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; + + /** + * Expense Reports + */ + private Optional deleteExpenseReportResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseReportsDeleteResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deleteExpenseReportResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deleteExpenseReportResponse, "deleteExpenseReportResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deleteExpenseReportResponse = deleteExpenseReportResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseReportsDeleteResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Reports + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deleteExpenseReportResponse() { + return (Optional) deleteExpenseReportResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseReportsDeleteResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseReportsDeleteResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseReportsDeleteResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Reports + */ + public AccountingExpenseReportsDeleteResponse withDeleteExpenseReportResponse(DeleteExpenseReportResponse deleteExpenseReportResponse) { + Utils.checkNotNull(deleteExpenseReportResponse, "deleteExpenseReportResponse"); + this.deleteExpenseReportResponse = Optional.ofNullable(deleteExpenseReportResponse); + return this; + } + + + /** + * Expense Reports + */ + public AccountingExpenseReportsDeleteResponse withDeleteExpenseReportResponse(Optional deleteExpenseReportResponse) { + Utils.checkNotNull(deleteExpenseReportResponse, "deleteExpenseReportResponse"); + this.deleteExpenseReportResponse = deleteExpenseReportResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseReportsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseReportsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsDeleteResponse other = (AccountingExpenseReportsDeleteResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.deleteExpenseReportResponse, other.deleteExpenseReportResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + deleteExpenseReportResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsDeleteResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deleteExpenseReportResponse", deleteExpenseReportResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deleteExpenseReportResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Reports + */ + public Builder deleteExpenseReportResponse(DeleteExpenseReportResponse deleteExpenseReportResponse) { + Utils.checkNotNull(deleteExpenseReportResponse, "deleteExpenseReportResponse"); + this.deleteExpenseReportResponse = Optional.ofNullable(deleteExpenseReportResponse); + return this; + } + + /** + * Expense Reports + */ + public Builder deleteExpenseReportResponse(Optional deleteExpenseReportResponse) { + Utils.checkNotNull(deleteExpenseReportResponse, "deleteExpenseReportResponse"); + this.deleteExpenseReportResponse = deleteExpenseReportResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseReportsDeleteResponse build() { + + return new AccountingExpenseReportsDeleteResponse( + contentType, statusCode, rawResponse, + deleteExpenseReportResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsOneRequest.java new file mode 100644 index 000000000..d25f79ed4 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsOneRequest.java @@ -0,0 +1,471 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; + + +public class AccountingExpenseReportsOneRequest { + /** + * ID of the record you are acting upon. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + private String id; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=fields") + private JsonNullable fields; + + @JsonCreator + public AccountingExpenseReportsOneRequest( + String id, + Optional consumerId, + Optional appId, + Optional serviceId, + Optional raw, + JsonNullable fields) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(raw, "raw"); + Utils.checkNotNull(fields, "fields"); + this.id = id; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.raw = raw; + this.fields = fields; + } + + public AccountingExpenseReportsOneRequest( + String id) { + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), JsonNullable.undefined()); + } + + /** + * ID of the record you are acting upon. + */ + @JsonIgnore + public String id() { + return id; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + @JsonIgnore + public JsonNullable fields() { + return fields; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * ID of the record you are acting upon. + */ + public AccountingExpenseReportsOneRequest withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseReportsOneRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseReportsOneRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingExpenseReportsOneRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingExpenseReportsOneRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseReportsOneRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseReportsOneRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseReportsOneRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseReportsOneRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public AccountingExpenseReportsOneRequest withFields(String fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = JsonNullable.of(fields); + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public AccountingExpenseReportsOneRequest withFields(JsonNullable fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = fields; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsOneRequest other = (AccountingExpenseReportsOneRequest) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.raw, other.raw) && + Utils.enhancedDeepEquals(this.fields, other.fields); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, consumerId, appId, + serviceId, raw, fields); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsOneRequest.class, + "id", id, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "raw", raw, + "fields", fields); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String id; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private Optional raw; + + private JsonNullable fields = JsonNullable.undefined(); + + private Builder() { + // force use of static builder() method + } + + + /** + * ID of the record you are acting upon. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public Builder fields(String fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = JsonNullable.of(fields); + return this; + } + + /** + * The 'fields' parameter allows API users to specify the fields they want to include in the API + * response. If this parameter is not present, the API will return all available fields. If this + * parameter is present, only the fields specified in the comma-separated string will be included in + * the response. + * + *

Nested properties can also be requested by using a dot notation.

Example: + * `fields=name,email,addresses.city`

In the example above, the response will only include + * the fields "name", "email" and "addresses.city". If any other fields are available, they will be + * excluded. + */ + public Builder fields(JsonNullable fields) { + Utils.checkNotNull(fields, "fields"); + this.fields = fields; + return this; + } + + public AccountingExpenseReportsOneRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + + return new AccountingExpenseReportsOneRequest( + id, consumerId, appId, + serviceId, raw, fields); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsOneRequestBuilder.java new file mode 100644 index 000000000..00bbed617 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsOneRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingExpenseReportsOne; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; + +public class AccountingExpenseReportsOneRequestBuilder { + + private AccountingExpenseReportsOneRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseReportsOneRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseReportsOneRequestBuilder request(AccountingExpenseReportsOneRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseReportsOneRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseReportsOneRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingExpenseReportsOneResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingExpenseReportsOne.Sync(sdkConfiguration, options, _headers); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsOneResponse.java new file mode 100644 index 000000000..b963fc77b --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsOneResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.GetExpenseReportResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseReportsOneResponse 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; + + /** + * Expense Reports + */ + private Optional getExpenseReportResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseReportsOneResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional getExpenseReportResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(getExpenseReportResponse, "getExpenseReportResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.getExpenseReportResponse = getExpenseReportResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseReportsOneResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Reports + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional getExpenseReportResponse() { + return (Optional) getExpenseReportResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseReportsOneResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseReportsOneResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseReportsOneResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Reports + */ + public AccountingExpenseReportsOneResponse withGetExpenseReportResponse(GetExpenseReportResponse getExpenseReportResponse) { + Utils.checkNotNull(getExpenseReportResponse, "getExpenseReportResponse"); + this.getExpenseReportResponse = Optional.ofNullable(getExpenseReportResponse); + return this; + } + + + /** + * Expense Reports + */ + public AccountingExpenseReportsOneResponse withGetExpenseReportResponse(Optional getExpenseReportResponse) { + Utils.checkNotNull(getExpenseReportResponse, "getExpenseReportResponse"); + this.getExpenseReportResponse = getExpenseReportResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseReportsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseReportsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsOneResponse other = (AccountingExpenseReportsOneResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getExpenseReportResponse, other.getExpenseReportResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + getExpenseReportResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsOneResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "getExpenseReportResponse", getExpenseReportResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional getExpenseReportResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Reports + */ + public Builder getExpenseReportResponse(GetExpenseReportResponse getExpenseReportResponse) { + Utils.checkNotNull(getExpenseReportResponse, "getExpenseReportResponse"); + this.getExpenseReportResponse = Optional.ofNullable(getExpenseReportResponse); + return this; + } + + /** + * Expense Reports + */ + public Builder getExpenseReportResponse(Optional getExpenseReportResponse) { + Utils.checkNotNull(getExpenseReportResponse, "getExpenseReportResponse"); + this.getExpenseReportResponse = getExpenseReportResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseReportsOneResponse build() { + + return new AccountingExpenseReportsOneResponse( + contentType, statusCode, rawResponse, + getExpenseReportResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsUpdateRequest.java new file mode 100644 index 000000000..03034ba9a --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsUpdateRequest.java @@ -0,0 +1,395 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.ExpenseReportInput; +import com.apideck.unify.utils.LazySingletonValue; +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.type.TypeReference; +import java.lang.Boolean; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + + +public class AccountingExpenseReportsUpdateRequest { + /** + * ID of the record you are acting upon. + */ + @SpeakeasyMetadata("pathParam:style=simple,explode=false,name=id") + private String id; + + /** + * ID of the consumer which you want to get or push data from + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") + private Optional consumerId; + + /** + * The ID of your Unify application + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") + private Optional appId; + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") + private Optional serviceId; + + /** + * Include raw response. Mostly used for debugging purposes + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") + private Optional raw; + + + @SpeakeasyMetadata("request:mediaType=application/json") + private ExpenseReportInput expenseReport; + + @JsonCreator + public AccountingExpenseReportsUpdateRequest( + String id, + Optional consumerId, + Optional appId, + Optional serviceId, + Optional raw, + ExpenseReportInput expenseReport) { + Utils.checkNotNull(id, "id"); + Utils.checkNotNull(consumerId, "consumerId"); + Utils.checkNotNull(appId, "appId"); + Utils.checkNotNull(serviceId, "serviceId"); + Utils.checkNotNull(raw, "raw"); + Utils.checkNotNull(expenseReport, "expenseReport"); + this.id = id; + this.consumerId = consumerId; + this.appId = appId; + this.serviceId = serviceId; + this.raw = raw; + this.expenseReport = expenseReport; + } + + public AccountingExpenseReportsUpdateRequest( + String id, + ExpenseReportInput expenseReport) { + this(id, Optional.empty(), Optional.empty(), + Optional.empty(), Optional.empty(), expenseReport); + } + + /** + * ID of the record you are acting upon. + */ + @JsonIgnore + public String id() { + return id; + } + + /** + * ID of the consumer which you want to get or push data from + */ + @JsonIgnore + public Optional consumerId() { + return consumerId; + } + + /** + * The ID of your Unify application + */ + @JsonIgnore + public Optional appId() { + return appId; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + @JsonIgnore + public Optional serviceId() { + return serviceId; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + @JsonIgnore + public Optional raw() { + return raw; + } + + @JsonIgnore + public ExpenseReportInput expenseReport() { + return expenseReport; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * ID of the record you are acting upon. + */ + public AccountingExpenseReportsUpdateRequest withId(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseReportsUpdateRequest withConsumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public AccountingExpenseReportsUpdateRequest withConsumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + /** + * The ID of your Unify application + */ + public AccountingExpenseReportsUpdateRequest withAppId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + + /** + * The ID of your Unify application + */ + public AccountingExpenseReportsUpdateRequest withAppId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseReportsUpdateRequest withServiceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public AccountingExpenseReportsUpdateRequest withServiceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseReportsUpdateRequest withRaw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public AccountingExpenseReportsUpdateRequest withRaw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + public AccountingExpenseReportsUpdateRequest withExpenseReport(ExpenseReportInput expenseReport) { + Utils.checkNotNull(expenseReport, "expenseReport"); + this.expenseReport = expenseReport; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsUpdateRequest other = (AccountingExpenseReportsUpdateRequest) o; + return + Utils.enhancedDeepEquals(this.id, other.id) && + Utils.enhancedDeepEquals(this.consumerId, other.consumerId) && + Utils.enhancedDeepEquals(this.appId, other.appId) && + Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && + Utils.enhancedDeepEquals(this.raw, other.raw) && + Utils.enhancedDeepEquals(this.expenseReport, other.expenseReport); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + id, consumerId, appId, + serviceId, raw, expenseReport); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsUpdateRequest.class, + "id", id, + "consumerId", consumerId, + "appId", appId, + "serviceId", serviceId, + "raw", raw, + "expenseReport", expenseReport); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String id; + + private Optional consumerId = Optional.empty(); + + private Optional appId = Optional.empty(); + + private Optional serviceId = Optional.empty(); + + private Optional raw; + + private ExpenseReportInput expenseReport; + + private Builder() { + // force use of static builder() method + } + + + /** + * ID of the record you are acting upon. + */ + public Builder id(String id) { + Utils.checkNotNull(id, "id"); + this.id = id; + return this; + } + + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(String consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = Optional.ofNullable(consumerId); + return this; + } + + /** + * ID of the consumer which you want to get or push data from + */ + public Builder consumerId(Optional consumerId) { + Utils.checkNotNull(consumerId, "consumerId"); + this.consumerId = consumerId; + return this; + } + + + /** + * The ID of your Unify application + */ + public Builder appId(String appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = Optional.ofNullable(appId); + return this; + } + + /** + * The ID of your Unify application + */ + public Builder appId(Optional appId) { + Utils.checkNotNull(appId, "appId"); + this.appId = appId; + return this; + } + + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(String serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = Optional.ofNullable(serviceId); + return this; + } + + /** + * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated + * multiple integrations for a Unified API. + */ + public Builder serviceId(Optional serviceId) { + Utils.checkNotNull(serviceId, "serviceId"); + this.serviceId = serviceId; + return this; + } + + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(boolean raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = Optional.ofNullable(raw); + return this; + } + + /** + * Include raw response. Mostly used for debugging purposes + */ + public Builder raw(Optional raw) { + Utils.checkNotNull(raw, "raw"); + this.raw = raw; + return this; + } + + + public Builder expenseReport(ExpenseReportInput expenseReport) { + Utils.checkNotNull(expenseReport, "expenseReport"); + this.expenseReport = expenseReport; + return this; + } + + public AccountingExpenseReportsUpdateRequest build() { + if (raw == null) { + raw = _SINGLETON_VALUE_Raw.value(); + } + + return new AccountingExpenseReportsUpdateRequest( + id, consumerId, appId, + serviceId, raw, expenseReport); + } + + + private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + new LazySingletonValue<>( + "raw", + "false", + new TypeReference>() {}); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsUpdateRequestBuilder.java new file mode 100644 index 000000000..813f81649 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsUpdateRequestBuilder.java @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.operations.AccountingExpenseReportsUpdate; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; + +public class AccountingExpenseReportsUpdateRequestBuilder { + + private AccountingExpenseReportsUpdateRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseReportsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseReportsUpdateRequestBuilder request(AccountingExpenseReportsUpdateRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseReportsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseReportsUpdateRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public AccountingExpenseReportsUpdateResponse call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + RequestOperation operation + = new AccountingExpenseReportsUpdate.Sync(sdkConfiguration, options, _headers); + + return operation.handleResponse(operation.doRequest(request)); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsUpdateResponse.java new file mode 100644 index 000000000..51d2340fb --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpenseReportsUpdateResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations; + +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.components.UpdateExpenseReportResponse; +import com.apideck.unify.utils.Response; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseReportsUpdateResponse 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; + + /** + * Expense Reports + */ + private Optional updateExpenseReportResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseReportsUpdateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional updateExpenseReportResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(updateExpenseReportResponse, "updateExpenseReportResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.updateExpenseReportResponse = updateExpenseReportResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseReportsUpdateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Reports + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updateExpenseReportResponse() { + return (Optional) updateExpenseReportResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseReportsUpdateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseReportsUpdateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseReportsUpdateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Reports + */ + public AccountingExpenseReportsUpdateResponse withUpdateExpenseReportResponse(UpdateExpenseReportResponse updateExpenseReportResponse) { + Utils.checkNotNull(updateExpenseReportResponse, "updateExpenseReportResponse"); + this.updateExpenseReportResponse = Optional.ofNullable(updateExpenseReportResponse); + return this; + } + + + /** + * Expense Reports + */ + public AccountingExpenseReportsUpdateResponse withUpdateExpenseReportResponse(Optional updateExpenseReportResponse) { + Utils.checkNotNull(updateExpenseReportResponse, "updateExpenseReportResponse"); + this.updateExpenseReportResponse = updateExpenseReportResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseReportsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseReportsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsUpdateResponse other = (AccountingExpenseReportsUpdateResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.updateExpenseReportResponse, other.updateExpenseReportResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + updateExpenseReportResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsUpdateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "updateExpenseReportResponse", updateExpenseReportResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional updateExpenseReportResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Reports + */ + public Builder updateExpenseReportResponse(UpdateExpenseReportResponse updateExpenseReportResponse) { + Utils.checkNotNull(updateExpenseReportResponse, "updateExpenseReportResponse"); + this.updateExpenseReportResponse = Optional.ofNullable(updateExpenseReportResponse); + return this; + } + + /** + * Expense Reports + */ + public Builder updateExpenseReportResponse(Optional updateExpenseReportResponse) { + Utils.checkNotNull(updateExpenseReportResponse, "updateExpenseReportResponse"); + this.updateExpenseReportResponse = updateExpenseReportResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseReportsUpdateResponse build() { + + return new AccountingExpenseReportsUpdateResponse( + contentType, statusCode, rawResponse, + updateExpenseReportResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesAddRequestBuilder.java new file mode 100644 index 000000000..14fcf40c4 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesAddRequestBuilder.java @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingEmployeesAddRequest; +import com.apideck.unify.operations.AccountingEmployeesAdd; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class AccountingEmployeesAddRequestBuilder { + + private AccountingEmployeesAddRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingEmployeesAddRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingEmployeesAddRequestBuilder request(AccountingEmployeesAddRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingEmployeesAddRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingEmployeesAddRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingEmployeesAdd.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesAddResponse.java new file mode 100644 index 000000000..c1a28c287 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesAddResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.CreateAccountingEmployeeResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingEmployeesAddResponse 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; + + /** + * Employees + */ + private Optional createAccountingEmployeeResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingEmployeesAddResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional createAccountingEmployeeResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(createAccountingEmployeeResponse, "createAccountingEmployeeResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.createAccountingEmployeeResponse = createAccountingEmployeeResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingEmployeesAddResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Employees + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createAccountingEmployeeResponse() { + return (Optional) createAccountingEmployeeResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingEmployeesAddResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingEmployeesAddResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingEmployeesAddResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Employees + */ + public AccountingEmployeesAddResponse withCreateAccountingEmployeeResponse(CreateAccountingEmployeeResponse createAccountingEmployeeResponse) { + Utils.checkNotNull(createAccountingEmployeeResponse, "createAccountingEmployeeResponse"); + this.createAccountingEmployeeResponse = Optional.ofNullable(createAccountingEmployeeResponse); + return this; + } + + + /** + * Employees + */ + public AccountingEmployeesAddResponse withCreateAccountingEmployeeResponse(Optional createAccountingEmployeeResponse) { + Utils.checkNotNull(createAccountingEmployeeResponse, "createAccountingEmployeeResponse"); + this.createAccountingEmployeeResponse = createAccountingEmployeeResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingEmployeesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingEmployeesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesAddResponse other = (AccountingEmployeesAddResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.createAccountingEmployeeResponse, other.createAccountingEmployeeResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + createAccountingEmployeeResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesAddResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "createAccountingEmployeeResponse", createAccountingEmployeeResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional createAccountingEmployeeResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Employees + */ + public Builder createAccountingEmployeeResponse(CreateAccountingEmployeeResponse createAccountingEmployeeResponse) { + Utils.checkNotNull(createAccountingEmployeeResponse, "createAccountingEmployeeResponse"); + this.createAccountingEmployeeResponse = Optional.ofNullable(createAccountingEmployeeResponse); + return this; + } + + /** + * Employees + */ + public Builder createAccountingEmployeeResponse(Optional createAccountingEmployeeResponse) { + Utils.checkNotNull(createAccountingEmployeeResponse, "createAccountingEmployeeResponse"); + this.createAccountingEmployeeResponse = createAccountingEmployeeResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingEmployeesAddResponse build() { + + return new AccountingEmployeesAddResponse( + contentType, statusCode, rawResponse, + createAccountingEmployeeResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesAllRequestBuilder.java new file mode 100644 index 000000000..f58360e7c --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesAllRequestBuilder.java @@ -0,0 +1,107 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; +import static com.apideck.unify.utils.reactive.ReactiveUtils.mapAsync; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingEmployeesAllRequest; +import com.apideck.unify.operations.AccountingEmployeesAll; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.apideck.unify.utils.pagination.AsyncPaginator; +import com.apideck.unify.utils.pagination.CursorTracker; +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.reactivestreams.FlowAdapters; +import org.reactivestreams.Publisher; + +public class AccountingEmployeesAllRequestBuilder { + + private AccountingEmployeesAllRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingEmployeesAllRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingEmployeesAllRequestBuilder request(AccountingEmployeesAllRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingEmployeesAllRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingEmployeesAllRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingEmployeesAll.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + 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<AccountingEmployeesAllResponse> publisher = builder.callAsPublisher();
+     * publisher.subscribe(new Subscriber<AccountingEmployeesAllResponse>() {
+     *     // Handle onNext, onError, onComplete
+     * });
+     * 
+ * + * @return A Publisher that emits pages asynchronously + */ + public Publisher callAsPublisher() { + AccountingEmployeesAllRequest request = this.request; + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingEmployeesAll.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + Flow.Publisher> asyncPaginator = new AsyncPaginator<>( + request, + new CursorTracker<>("$.meta.cursors.next", String.class), + AccountingEmployeesAllRequest::withCursor, + operation::doRequest); + + Flow.Publisher flowPublisher = mapAsync(asyncPaginator, operation::handleResponse); + + // Convert Flow.Publisher to Reactive Streams Publisher at the last stage + return FlowAdapters.toPublisher(flowPublisher); + } + +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesAllResponse.java new file mode 100644 index 000000000..4c2bb9b0a --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesAllResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.GetAccountingEmployeesResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingEmployeesAllResponse 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; + + /** + * Employees + */ + private Optional getAccountingEmployeesResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingEmployeesAllResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional getAccountingEmployeesResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(getAccountingEmployeesResponse, "getAccountingEmployeesResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.getAccountingEmployeesResponse = getAccountingEmployeesResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingEmployeesAllResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Employees + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional getAccountingEmployeesResponse() { + return (Optional) getAccountingEmployeesResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingEmployeesAllResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingEmployeesAllResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingEmployeesAllResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Employees + */ + public AccountingEmployeesAllResponse withGetAccountingEmployeesResponse(GetAccountingEmployeesResponse getAccountingEmployeesResponse) { + Utils.checkNotNull(getAccountingEmployeesResponse, "getAccountingEmployeesResponse"); + this.getAccountingEmployeesResponse = Optional.ofNullable(getAccountingEmployeesResponse); + return this; + } + + + /** + * Employees + */ + public AccountingEmployeesAllResponse withGetAccountingEmployeesResponse(Optional getAccountingEmployeesResponse) { + Utils.checkNotNull(getAccountingEmployeesResponse, "getAccountingEmployeesResponse"); + this.getAccountingEmployeesResponse = getAccountingEmployeesResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingEmployeesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingEmployeesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesAllResponse other = (AccountingEmployeesAllResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getAccountingEmployeesResponse, other.getAccountingEmployeesResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + getAccountingEmployeesResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesAllResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "getAccountingEmployeesResponse", getAccountingEmployeesResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional getAccountingEmployeesResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Employees + */ + public Builder getAccountingEmployeesResponse(GetAccountingEmployeesResponse getAccountingEmployeesResponse) { + Utils.checkNotNull(getAccountingEmployeesResponse, "getAccountingEmployeesResponse"); + this.getAccountingEmployeesResponse = Optional.ofNullable(getAccountingEmployeesResponse); + return this; + } + + /** + * Employees + */ + public Builder getAccountingEmployeesResponse(Optional getAccountingEmployeesResponse) { + Utils.checkNotNull(getAccountingEmployeesResponse, "getAccountingEmployeesResponse"); + this.getAccountingEmployeesResponse = getAccountingEmployeesResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingEmployeesAllResponse build() { + + return new AccountingEmployeesAllResponse( + contentType, statusCode, rawResponse, + getAccountingEmployeesResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesDeleteRequestBuilder.java new file mode 100644 index 000000000..9ad503173 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesDeleteRequestBuilder.java @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingEmployeesDeleteRequest; +import com.apideck.unify.operations.AccountingEmployeesDelete; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class AccountingEmployeesDeleteRequestBuilder { + + private AccountingEmployeesDeleteRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingEmployeesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingEmployeesDeleteRequestBuilder request(AccountingEmployeesDeleteRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingEmployeesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingEmployeesDeleteRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingEmployeesDelete.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesDeleteResponse.java new file mode 100644 index 000000000..30acf9fe1 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesDeleteResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.DeleteAccountingEmployeeResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingEmployeesDeleteResponse 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; + + /** + * Employees + */ + private Optional deleteAccountingEmployeeResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingEmployeesDeleteResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deleteAccountingEmployeeResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deleteAccountingEmployeeResponse, "deleteAccountingEmployeeResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deleteAccountingEmployeeResponse = deleteAccountingEmployeeResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingEmployeesDeleteResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Employees + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deleteAccountingEmployeeResponse() { + return (Optional) deleteAccountingEmployeeResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingEmployeesDeleteResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingEmployeesDeleteResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingEmployeesDeleteResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Employees + */ + public AccountingEmployeesDeleteResponse withDeleteAccountingEmployeeResponse(DeleteAccountingEmployeeResponse deleteAccountingEmployeeResponse) { + Utils.checkNotNull(deleteAccountingEmployeeResponse, "deleteAccountingEmployeeResponse"); + this.deleteAccountingEmployeeResponse = Optional.ofNullable(deleteAccountingEmployeeResponse); + return this; + } + + + /** + * Employees + */ + public AccountingEmployeesDeleteResponse withDeleteAccountingEmployeeResponse(Optional deleteAccountingEmployeeResponse) { + Utils.checkNotNull(deleteAccountingEmployeeResponse, "deleteAccountingEmployeeResponse"); + this.deleteAccountingEmployeeResponse = deleteAccountingEmployeeResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingEmployeesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingEmployeesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesDeleteResponse other = (AccountingEmployeesDeleteResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.deleteAccountingEmployeeResponse, other.deleteAccountingEmployeeResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + deleteAccountingEmployeeResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesDeleteResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deleteAccountingEmployeeResponse", deleteAccountingEmployeeResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deleteAccountingEmployeeResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Employees + */ + public Builder deleteAccountingEmployeeResponse(DeleteAccountingEmployeeResponse deleteAccountingEmployeeResponse) { + Utils.checkNotNull(deleteAccountingEmployeeResponse, "deleteAccountingEmployeeResponse"); + this.deleteAccountingEmployeeResponse = Optional.ofNullable(deleteAccountingEmployeeResponse); + return this; + } + + /** + * Employees + */ + public Builder deleteAccountingEmployeeResponse(Optional deleteAccountingEmployeeResponse) { + Utils.checkNotNull(deleteAccountingEmployeeResponse, "deleteAccountingEmployeeResponse"); + this.deleteAccountingEmployeeResponse = deleteAccountingEmployeeResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingEmployeesDeleteResponse build() { + + return new AccountingEmployeesDeleteResponse( + contentType, statusCode, rawResponse, + deleteAccountingEmployeeResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesOneRequestBuilder.java new file mode 100644 index 000000000..78356bafd --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesOneRequestBuilder.java @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingEmployeesOneRequest; +import com.apideck.unify.operations.AccountingEmployeesOne; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class AccountingEmployeesOneRequestBuilder { + + private AccountingEmployeesOneRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingEmployeesOneRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingEmployeesOneRequestBuilder request(AccountingEmployeesOneRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingEmployeesOneRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingEmployeesOneRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingEmployeesOne.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesOneResponse.java new file mode 100644 index 000000000..16b4c457b --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesOneResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.GetAccountingEmployeeResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingEmployeesOneResponse 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; + + /** + * Employees + */ + private Optional getAccountingEmployeeResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingEmployeesOneResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional getAccountingEmployeeResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(getAccountingEmployeeResponse, "getAccountingEmployeeResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.getAccountingEmployeeResponse = getAccountingEmployeeResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingEmployeesOneResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Employees + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional getAccountingEmployeeResponse() { + return (Optional) getAccountingEmployeeResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingEmployeesOneResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingEmployeesOneResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingEmployeesOneResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Employees + */ + public AccountingEmployeesOneResponse withGetAccountingEmployeeResponse(GetAccountingEmployeeResponse getAccountingEmployeeResponse) { + Utils.checkNotNull(getAccountingEmployeeResponse, "getAccountingEmployeeResponse"); + this.getAccountingEmployeeResponse = Optional.ofNullable(getAccountingEmployeeResponse); + return this; + } + + + /** + * Employees + */ + public AccountingEmployeesOneResponse withGetAccountingEmployeeResponse(Optional getAccountingEmployeeResponse) { + Utils.checkNotNull(getAccountingEmployeeResponse, "getAccountingEmployeeResponse"); + this.getAccountingEmployeeResponse = getAccountingEmployeeResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingEmployeesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingEmployeesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesOneResponse other = (AccountingEmployeesOneResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getAccountingEmployeeResponse, other.getAccountingEmployeeResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + getAccountingEmployeeResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesOneResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "getAccountingEmployeeResponse", getAccountingEmployeeResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional getAccountingEmployeeResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Employees + */ + public Builder getAccountingEmployeeResponse(GetAccountingEmployeeResponse getAccountingEmployeeResponse) { + Utils.checkNotNull(getAccountingEmployeeResponse, "getAccountingEmployeeResponse"); + this.getAccountingEmployeeResponse = Optional.ofNullable(getAccountingEmployeeResponse); + return this; + } + + /** + * Employees + */ + public Builder getAccountingEmployeeResponse(Optional getAccountingEmployeeResponse) { + Utils.checkNotNull(getAccountingEmployeeResponse, "getAccountingEmployeeResponse"); + this.getAccountingEmployeeResponse = getAccountingEmployeeResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingEmployeesOneResponse build() { + + return new AccountingEmployeesOneResponse( + contentType, statusCode, rawResponse, + getAccountingEmployeeResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesUpdateRequestBuilder.java new file mode 100644 index 000000000..a59d8a97d --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesUpdateRequestBuilder.java @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingEmployeesUpdateRequest; +import com.apideck.unify.operations.AccountingEmployeesUpdate; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class AccountingEmployeesUpdateRequestBuilder { + + private AccountingEmployeesUpdateRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingEmployeesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingEmployeesUpdateRequestBuilder request(AccountingEmployeesUpdateRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingEmployeesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingEmployeesUpdateRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingEmployeesUpdate.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesUpdateResponse.java new file mode 100644 index 000000000..75ddad36a --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingEmployeesUpdateResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.components.UpdateAccountingEmployeeResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingEmployeesUpdateResponse 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; + + /** + * Employees + */ + private Optional updateAccountingEmployeeResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingEmployeesUpdateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional updateAccountingEmployeeResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(updateAccountingEmployeeResponse, "updateAccountingEmployeeResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.updateAccountingEmployeeResponse = updateAccountingEmployeeResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingEmployeesUpdateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Employees + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updateAccountingEmployeeResponse() { + return (Optional) updateAccountingEmployeeResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingEmployeesUpdateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingEmployeesUpdateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingEmployeesUpdateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Employees + */ + public AccountingEmployeesUpdateResponse withUpdateAccountingEmployeeResponse(UpdateAccountingEmployeeResponse updateAccountingEmployeeResponse) { + Utils.checkNotNull(updateAccountingEmployeeResponse, "updateAccountingEmployeeResponse"); + this.updateAccountingEmployeeResponse = Optional.ofNullable(updateAccountingEmployeeResponse); + return this; + } + + + /** + * Employees + */ + public AccountingEmployeesUpdateResponse withUpdateAccountingEmployeeResponse(Optional updateAccountingEmployeeResponse) { + Utils.checkNotNull(updateAccountingEmployeeResponse, "updateAccountingEmployeeResponse"); + this.updateAccountingEmployeeResponse = updateAccountingEmployeeResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingEmployeesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingEmployeesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingEmployeesUpdateResponse other = (AccountingEmployeesUpdateResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.updateAccountingEmployeeResponse, other.updateAccountingEmployeeResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + updateAccountingEmployeeResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingEmployeesUpdateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "updateAccountingEmployeeResponse", updateAccountingEmployeeResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional updateAccountingEmployeeResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Employees + */ + public Builder updateAccountingEmployeeResponse(UpdateAccountingEmployeeResponse updateAccountingEmployeeResponse) { + Utils.checkNotNull(updateAccountingEmployeeResponse, "updateAccountingEmployeeResponse"); + this.updateAccountingEmployeeResponse = Optional.ofNullable(updateAccountingEmployeeResponse); + return this; + } + + /** + * Employees + */ + public Builder updateAccountingEmployeeResponse(Optional updateAccountingEmployeeResponse) { + Utils.checkNotNull(updateAccountingEmployeeResponse, "updateAccountingEmployeeResponse"); + this.updateAccountingEmployeeResponse = updateAccountingEmployeeResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingEmployeesUpdateResponse build() { + + return new AccountingEmployeesUpdateResponse( + contentType, statusCode, rawResponse, + updateAccountingEmployeeResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesAddRequestBuilder.java new file mode 100644 index 000000000..eaadd01db --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesAddRequestBuilder.java @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAddRequest; +import com.apideck.unify.operations.AccountingExpenseCategoriesAdd; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class AccountingExpenseCategoriesAddRequestBuilder { + + private AccountingExpenseCategoriesAddRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseCategoriesAddRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseCategoriesAddRequestBuilder request(AccountingExpenseCategoriesAddRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseCategoriesAddRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseCategoriesAddRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingExpenseCategoriesAdd.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesAddResponse.java new file mode 100644 index 000000000..85e639086 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesAddResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.CreateExpenseCategoryResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseCategoriesAddResponse 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; + + /** + * Expense Categories + */ + private Optional createExpenseCategoryResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseCategoriesAddResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional createExpenseCategoryResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(createExpenseCategoryResponse, "createExpenseCategoryResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.createExpenseCategoryResponse = createExpenseCategoryResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseCategoriesAddResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Categories + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createExpenseCategoryResponse() { + return (Optional) createExpenseCategoryResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseCategoriesAddResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseCategoriesAddResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseCategoriesAddResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesAddResponse withCreateExpenseCategoryResponse(CreateExpenseCategoryResponse createExpenseCategoryResponse) { + Utils.checkNotNull(createExpenseCategoryResponse, "createExpenseCategoryResponse"); + this.createExpenseCategoryResponse = Optional.ofNullable(createExpenseCategoryResponse); + return this; + } + + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesAddResponse withCreateExpenseCategoryResponse(Optional createExpenseCategoryResponse) { + Utils.checkNotNull(createExpenseCategoryResponse, "createExpenseCategoryResponse"); + this.createExpenseCategoryResponse = createExpenseCategoryResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesAddResponse other = (AccountingExpenseCategoriesAddResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.createExpenseCategoryResponse, other.createExpenseCategoryResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + createExpenseCategoryResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesAddResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "createExpenseCategoryResponse", createExpenseCategoryResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional createExpenseCategoryResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Categories + */ + public Builder createExpenseCategoryResponse(CreateExpenseCategoryResponse createExpenseCategoryResponse) { + Utils.checkNotNull(createExpenseCategoryResponse, "createExpenseCategoryResponse"); + this.createExpenseCategoryResponse = Optional.ofNullable(createExpenseCategoryResponse); + return this; + } + + /** + * Expense Categories + */ + public Builder createExpenseCategoryResponse(Optional createExpenseCategoryResponse) { + Utils.checkNotNull(createExpenseCategoryResponse, "createExpenseCategoryResponse"); + this.createExpenseCategoryResponse = createExpenseCategoryResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseCategoriesAddResponse build() { + + return new AccountingExpenseCategoriesAddResponse( + contentType, statusCode, rawResponse, + createExpenseCategoryResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesAllRequestBuilder.java new file mode 100644 index 000000000..138d49ec4 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesAllRequestBuilder.java @@ -0,0 +1,107 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; +import static com.apideck.unify.utils.reactive.ReactiveUtils.mapAsync; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAllRequest; +import com.apideck.unify.operations.AccountingExpenseCategoriesAll; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.apideck.unify.utils.pagination.AsyncPaginator; +import com.apideck.unify.utils.pagination.CursorTracker; +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.reactivestreams.FlowAdapters; +import org.reactivestreams.Publisher; + +public class AccountingExpenseCategoriesAllRequestBuilder { + + private AccountingExpenseCategoriesAllRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseCategoriesAllRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseCategoriesAllRequestBuilder request(AccountingExpenseCategoriesAllRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseCategoriesAllRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseCategoriesAllRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingExpenseCategoriesAll.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + 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<AccountingExpenseCategoriesAllResponse> publisher = builder.callAsPublisher();
+     * publisher.subscribe(new Subscriber<AccountingExpenseCategoriesAllResponse>() {
+     *     // Handle onNext, onError, onComplete
+     * });
+     * 
+ * + * @return A Publisher that emits pages asynchronously + */ + public Publisher callAsPublisher() { + AccountingExpenseCategoriesAllRequest request = this.request; + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingExpenseCategoriesAll.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + Flow.Publisher> asyncPaginator = new AsyncPaginator<>( + request, + new CursorTracker<>("$.meta.cursors.next", String.class), + AccountingExpenseCategoriesAllRequest::withCursor, + operation::doRequest); + + Flow.Publisher flowPublisher = mapAsync(asyncPaginator, operation::handleResponse); + + // Convert Flow.Publisher to Reactive Streams Publisher at the last stage + return FlowAdapters.toPublisher(flowPublisher); + } + +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesAllResponse.java new file mode 100644 index 000000000..8518028fb --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesAllResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.GetExpenseCategoriesResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseCategoriesAllResponse 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; + + /** + * Expense Categories + */ + private Optional getExpenseCategoriesResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseCategoriesAllResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional getExpenseCategoriesResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(getExpenseCategoriesResponse, "getExpenseCategoriesResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.getExpenseCategoriesResponse = getExpenseCategoriesResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseCategoriesAllResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Categories + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional getExpenseCategoriesResponse() { + return (Optional) getExpenseCategoriesResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseCategoriesAllResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseCategoriesAllResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseCategoriesAllResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesAllResponse withGetExpenseCategoriesResponse(GetExpenseCategoriesResponse getExpenseCategoriesResponse) { + Utils.checkNotNull(getExpenseCategoriesResponse, "getExpenseCategoriesResponse"); + this.getExpenseCategoriesResponse = Optional.ofNullable(getExpenseCategoriesResponse); + return this; + } + + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesAllResponse withGetExpenseCategoriesResponse(Optional getExpenseCategoriesResponse) { + Utils.checkNotNull(getExpenseCategoriesResponse, "getExpenseCategoriesResponse"); + this.getExpenseCategoriesResponse = getExpenseCategoriesResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesAllResponse other = (AccountingExpenseCategoriesAllResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getExpenseCategoriesResponse, other.getExpenseCategoriesResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + getExpenseCategoriesResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesAllResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "getExpenseCategoriesResponse", getExpenseCategoriesResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional getExpenseCategoriesResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Categories + */ + public Builder getExpenseCategoriesResponse(GetExpenseCategoriesResponse getExpenseCategoriesResponse) { + Utils.checkNotNull(getExpenseCategoriesResponse, "getExpenseCategoriesResponse"); + this.getExpenseCategoriesResponse = Optional.ofNullable(getExpenseCategoriesResponse); + return this; + } + + /** + * Expense Categories + */ + public Builder getExpenseCategoriesResponse(Optional getExpenseCategoriesResponse) { + Utils.checkNotNull(getExpenseCategoriesResponse, "getExpenseCategoriesResponse"); + this.getExpenseCategoriesResponse = getExpenseCategoriesResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseCategoriesAllResponse build() { + + return new AccountingExpenseCategoriesAllResponse( + contentType, statusCode, rawResponse, + getExpenseCategoriesResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesDeleteRequestBuilder.java new file mode 100644 index 000000000..ac6ee5ea1 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesDeleteRequestBuilder.java @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesDeleteRequest; +import com.apideck.unify.operations.AccountingExpenseCategoriesDelete; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class AccountingExpenseCategoriesDeleteRequestBuilder { + + private AccountingExpenseCategoriesDeleteRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseCategoriesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseCategoriesDeleteRequestBuilder request(AccountingExpenseCategoriesDeleteRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseCategoriesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseCategoriesDeleteRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingExpenseCategoriesDelete.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesDeleteResponse.java new file mode 100644 index 000000000..60a55aac7 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesDeleteResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.DeleteExpenseCategoryResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseCategoriesDeleteResponse 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; + + /** + * Expense Categories + */ + private Optional deleteExpenseCategoryResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseCategoriesDeleteResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deleteExpenseCategoryResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deleteExpenseCategoryResponse, "deleteExpenseCategoryResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deleteExpenseCategoryResponse = deleteExpenseCategoryResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseCategoriesDeleteResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Categories + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deleteExpenseCategoryResponse() { + return (Optional) deleteExpenseCategoryResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseCategoriesDeleteResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseCategoriesDeleteResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseCategoriesDeleteResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesDeleteResponse withDeleteExpenseCategoryResponse(DeleteExpenseCategoryResponse deleteExpenseCategoryResponse) { + Utils.checkNotNull(deleteExpenseCategoryResponse, "deleteExpenseCategoryResponse"); + this.deleteExpenseCategoryResponse = Optional.ofNullable(deleteExpenseCategoryResponse); + return this; + } + + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesDeleteResponse withDeleteExpenseCategoryResponse(Optional deleteExpenseCategoryResponse) { + Utils.checkNotNull(deleteExpenseCategoryResponse, "deleteExpenseCategoryResponse"); + this.deleteExpenseCategoryResponse = deleteExpenseCategoryResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesDeleteResponse other = (AccountingExpenseCategoriesDeleteResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.deleteExpenseCategoryResponse, other.deleteExpenseCategoryResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + deleteExpenseCategoryResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesDeleteResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deleteExpenseCategoryResponse", deleteExpenseCategoryResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deleteExpenseCategoryResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Categories + */ + public Builder deleteExpenseCategoryResponse(DeleteExpenseCategoryResponse deleteExpenseCategoryResponse) { + Utils.checkNotNull(deleteExpenseCategoryResponse, "deleteExpenseCategoryResponse"); + this.deleteExpenseCategoryResponse = Optional.ofNullable(deleteExpenseCategoryResponse); + return this; + } + + /** + * Expense Categories + */ + public Builder deleteExpenseCategoryResponse(Optional deleteExpenseCategoryResponse) { + Utils.checkNotNull(deleteExpenseCategoryResponse, "deleteExpenseCategoryResponse"); + this.deleteExpenseCategoryResponse = deleteExpenseCategoryResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseCategoriesDeleteResponse build() { + + return new AccountingExpenseCategoriesDeleteResponse( + contentType, statusCode, rawResponse, + deleteExpenseCategoryResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesOneRequestBuilder.java new file mode 100644 index 000000000..6ee935b04 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesOneRequestBuilder.java @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesOneRequest; +import com.apideck.unify.operations.AccountingExpenseCategoriesOne; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class AccountingExpenseCategoriesOneRequestBuilder { + + private AccountingExpenseCategoriesOneRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseCategoriesOneRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseCategoriesOneRequestBuilder request(AccountingExpenseCategoriesOneRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseCategoriesOneRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseCategoriesOneRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingExpenseCategoriesOne.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesOneResponse.java new file mode 100644 index 000000000..984f2e33a --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesOneResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.GetExpenseCategoryResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseCategoriesOneResponse 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; + + /** + * Expense Categories + */ + private Optional getExpenseCategoryResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseCategoriesOneResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional getExpenseCategoryResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(getExpenseCategoryResponse, "getExpenseCategoryResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.getExpenseCategoryResponse = getExpenseCategoryResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseCategoriesOneResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Categories + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional getExpenseCategoryResponse() { + return (Optional) getExpenseCategoryResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseCategoriesOneResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseCategoriesOneResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseCategoriesOneResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesOneResponse withGetExpenseCategoryResponse(GetExpenseCategoryResponse getExpenseCategoryResponse) { + Utils.checkNotNull(getExpenseCategoryResponse, "getExpenseCategoryResponse"); + this.getExpenseCategoryResponse = Optional.ofNullable(getExpenseCategoryResponse); + return this; + } + + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesOneResponse withGetExpenseCategoryResponse(Optional getExpenseCategoryResponse) { + Utils.checkNotNull(getExpenseCategoryResponse, "getExpenseCategoryResponse"); + this.getExpenseCategoryResponse = getExpenseCategoryResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesOneResponse other = (AccountingExpenseCategoriesOneResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getExpenseCategoryResponse, other.getExpenseCategoryResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + getExpenseCategoryResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesOneResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "getExpenseCategoryResponse", getExpenseCategoryResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional getExpenseCategoryResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Categories + */ + public Builder getExpenseCategoryResponse(GetExpenseCategoryResponse getExpenseCategoryResponse) { + Utils.checkNotNull(getExpenseCategoryResponse, "getExpenseCategoryResponse"); + this.getExpenseCategoryResponse = Optional.ofNullable(getExpenseCategoryResponse); + return this; + } + + /** + * Expense Categories + */ + public Builder getExpenseCategoryResponse(Optional getExpenseCategoryResponse) { + Utils.checkNotNull(getExpenseCategoryResponse, "getExpenseCategoryResponse"); + this.getExpenseCategoryResponse = getExpenseCategoryResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseCategoriesOneResponse build() { + + return new AccountingExpenseCategoriesOneResponse( + contentType, statusCode, rawResponse, + getExpenseCategoryResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesUpdateRequestBuilder.java new file mode 100644 index 000000000..bc65f3d87 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesUpdateRequestBuilder.java @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesUpdateRequest; +import com.apideck.unify.operations.AccountingExpenseCategoriesUpdate; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class AccountingExpenseCategoriesUpdateRequestBuilder { + + private AccountingExpenseCategoriesUpdateRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseCategoriesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseCategoriesUpdateRequestBuilder request(AccountingExpenseCategoriesUpdateRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseCategoriesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseCategoriesUpdateRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingExpenseCategoriesUpdate.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesUpdateResponse.java new file mode 100644 index 000000000..bbc5ba8da --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseCategoriesUpdateResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.components.UpdateExpenseCategoryResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseCategoriesUpdateResponse 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; + + /** + * Expense Categories + */ + private Optional updateExpenseCategoryResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseCategoriesUpdateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional updateExpenseCategoryResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(updateExpenseCategoryResponse, "updateExpenseCategoryResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.updateExpenseCategoryResponse = updateExpenseCategoryResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseCategoriesUpdateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Categories + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updateExpenseCategoryResponse() { + return (Optional) updateExpenseCategoryResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseCategoriesUpdateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseCategoriesUpdateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseCategoriesUpdateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesUpdateResponse withUpdateExpenseCategoryResponse(UpdateExpenseCategoryResponse updateExpenseCategoryResponse) { + Utils.checkNotNull(updateExpenseCategoryResponse, "updateExpenseCategoryResponse"); + this.updateExpenseCategoryResponse = Optional.ofNullable(updateExpenseCategoryResponse); + return this; + } + + + /** + * Expense Categories + */ + public AccountingExpenseCategoriesUpdateResponse withUpdateExpenseCategoryResponse(Optional updateExpenseCategoryResponse) { + Utils.checkNotNull(updateExpenseCategoryResponse, "updateExpenseCategoryResponse"); + this.updateExpenseCategoryResponse = updateExpenseCategoryResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseCategoriesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseCategoriesUpdateResponse other = (AccountingExpenseCategoriesUpdateResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.updateExpenseCategoryResponse, other.updateExpenseCategoryResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + updateExpenseCategoryResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseCategoriesUpdateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "updateExpenseCategoryResponse", updateExpenseCategoryResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional updateExpenseCategoryResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Categories + */ + public Builder updateExpenseCategoryResponse(UpdateExpenseCategoryResponse updateExpenseCategoryResponse) { + Utils.checkNotNull(updateExpenseCategoryResponse, "updateExpenseCategoryResponse"); + this.updateExpenseCategoryResponse = Optional.ofNullable(updateExpenseCategoryResponse); + return this; + } + + /** + * Expense Categories + */ + public Builder updateExpenseCategoryResponse(Optional updateExpenseCategoryResponse) { + Utils.checkNotNull(updateExpenseCategoryResponse, "updateExpenseCategoryResponse"); + this.updateExpenseCategoryResponse = updateExpenseCategoryResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseCategoriesUpdateResponse build() { + + return new AccountingExpenseCategoriesUpdateResponse( + contentType, statusCode, rawResponse, + updateExpenseCategoryResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsAddRequestBuilder.java new file mode 100644 index 000000000..8b4b35bf9 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsAddRequestBuilder.java @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingExpenseReportsAddRequest; +import com.apideck.unify.operations.AccountingExpenseReportsAdd; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class AccountingExpenseReportsAddRequestBuilder { + + private AccountingExpenseReportsAddRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseReportsAddRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseReportsAddRequestBuilder request(AccountingExpenseReportsAddRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseReportsAddRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseReportsAddRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingExpenseReportsAdd.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsAddResponse.java new file mode 100644 index 000000000..10f9f6563 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsAddResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.CreateExpenseReportResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseReportsAddResponse 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; + + /** + * Expense Reports + */ + private Optional createExpenseReportResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseReportsAddResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional createExpenseReportResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(createExpenseReportResponse, "createExpenseReportResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.createExpenseReportResponse = createExpenseReportResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseReportsAddResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Reports + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional createExpenseReportResponse() { + return (Optional) createExpenseReportResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseReportsAddResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseReportsAddResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseReportsAddResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Reports + */ + public AccountingExpenseReportsAddResponse withCreateExpenseReportResponse(CreateExpenseReportResponse createExpenseReportResponse) { + Utils.checkNotNull(createExpenseReportResponse, "createExpenseReportResponse"); + this.createExpenseReportResponse = Optional.ofNullable(createExpenseReportResponse); + return this; + } + + + /** + * Expense Reports + */ + public AccountingExpenseReportsAddResponse withCreateExpenseReportResponse(Optional createExpenseReportResponse) { + Utils.checkNotNull(createExpenseReportResponse, "createExpenseReportResponse"); + this.createExpenseReportResponse = createExpenseReportResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseReportsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseReportsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsAddResponse other = (AccountingExpenseReportsAddResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.createExpenseReportResponse, other.createExpenseReportResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + createExpenseReportResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsAddResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "createExpenseReportResponse", createExpenseReportResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional createExpenseReportResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Reports + */ + public Builder createExpenseReportResponse(CreateExpenseReportResponse createExpenseReportResponse) { + Utils.checkNotNull(createExpenseReportResponse, "createExpenseReportResponse"); + this.createExpenseReportResponse = Optional.ofNullable(createExpenseReportResponse); + return this; + } + + /** + * Expense Reports + */ + public Builder createExpenseReportResponse(Optional createExpenseReportResponse) { + Utils.checkNotNull(createExpenseReportResponse, "createExpenseReportResponse"); + this.createExpenseReportResponse = createExpenseReportResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseReportsAddResponse build() { + + return new AccountingExpenseReportsAddResponse( + contentType, statusCode, rawResponse, + createExpenseReportResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsAllRequestBuilder.java new file mode 100644 index 000000000..acbeb2c41 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsAllRequestBuilder.java @@ -0,0 +1,107 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; +import static com.apideck.unify.utils.reactive.ReactiveUtils.mapAsync; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingExpenseReportsAllRequest; +import com.apideck.unify.operations.AccountingExpenseReportsAll; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.apideck.unify.utils.pagination.AsyncPaginator; +import com.apideck.unify.utils.pagination.CursorTracker; +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.reactivestreams.FlowAdapters; +import org.reactivestreams.Publisher; + +public class AccountingExpenseReportsAllRequestBuilder { + + private AccountingExpenseReportsAllRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseReportsAllRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseReportsAllRequestBuilder request(AccountingExpenseReportsAllRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseReportsAllRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseReportsAllRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingExpenseReportsAll.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + 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<AccountingExpenseReportsAllResponse> publisher = builder.callAsPublisher();
+     * publisher.subscribe(new Subscriber<AccountingExpenseReportsAllResponse>() {
+     *     // Handle onNext, onError, onComplete
+     * });
+     * 
+ * + * @return A Publisher that emits pages asynchronously + */ + public Publisher callAsPublisher() { + AccountingExpenseReportsAllRequest request = this.request; + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingExpenseReportsAll.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + Flow.Publisher> asyncPaginator = new AsyncPaginator<>( + request, + new CursorTracker<>("$.meta.cursors.next", String.class), + AccountingExpenseReportsAllRequest::withCursor, + operation::doRequest); + + Flow.Publisher flowPublisher = mapAsync(asyncPaginator, operation::handleResponse); + + // Convert Flow.Publisher to Reactive Streams Publisher at the last stage + return FlowAdapters.toPublisher(flowPublisher); + } + +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsAllResponse.java new file mode 100644 index 000000000..5e92cc85a --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsAllResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.GetExpenseReportsResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseReportsAllResponse 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; + + /** + * Expense Reports + */ + private Optional getExpenseReportsResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseReportsAllResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional getExpenseReportsResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(getExpenseReportsResponse, "getExpenseReportsResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.getExpenseReportsResponse = getExpenseReportsResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseReportsAllResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Reports + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional getExpenseReportsResponse() { + return (Optional) getExpenseReportsResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseReportsAllResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseReportsAllResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseReportsAllResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Reports + */ + public AccountingExpenseReportsAllResponse withGetExpenseReportsResponse(GetExpenseReportsResponse getExpenseReportsResponse) { + Utils.checkNotNull(getExpenseReportsResponse, "getExpenseReportsResponse"); + this.getExpenseReportsResponse = Optional.ofNullable(getExpenseReportsResponse); + return this; + } + + + /** + * Expense Reports + */ + public AccountingExpenseReportsAllResponse withGetExpenseReportsResponse(Optional getExpenseReportsResponse) { + Utils.checkNotNull(getExpenseReportsResponse, "getExpenseReportsResponse"); + this.getExpenseReportsResponse = getExpenseReportsResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseReportsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseReportsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsAllResponse other = (AccountingExpenseReportsAllResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getExpenseReportsResponse, other.getExpenseReportsResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + getExpenseReportsResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsAllResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "getExpenseReportsResponse", getExpenseReportsResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional getExpenseReportsResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Reports + */ + public Builder getExpenseReportsResponse(GetExpenseReportsResponse getExpenseReportsResponse) { + Utils.checkNotNull(getExpenseReportsResponse, "getExpenseReportsResponse"); + this.getExpenseReportsResponse = Optional.ofNullable(getExpenseReportsResponse); + return this; + } + + /** + * Expense Reports + */ + public Builder getExpenseReportsResponse(Optional getExpenseReportsResponse) { + Utils.checkNotNull(getExpenseReportsResponse, "getExpenseReportsResponse"); + this.getExpenseReportsResponse = getExpenseReportsResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseReportsAllResponse build() { + + return new AccountingExpenseReportsAllResponse( + contentType, statusCode, rawResponse, + getExpenseReportsResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsDeleteRequestBuilder.java new file mode 100644 index 000000000..c01220019 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsDeleteRequestBuilder.java @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingExpenseReportsDeleteRequest; +import com.apideck.unify.operations.AccountingExpenseReportsDelete; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class AccountingExpenseReportsDeleteRequestBuilder { + + private AccountingExpenseReportsDeleteRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseReportsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseReportsDeleteRequestBuilder request(AccountingExpenseReportsDeleteRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseReportsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseReportsDeleteRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingExpenseReportsDelete.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsDeleteResponse.java new file mode 100644 index 000000000..98a486def --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsDeleteResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.DeleteExpenseReportResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseReportsDeleteResponse 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; + + /** + * Expense Reports + */ + private Optional deleteExpenseReportResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseReportsDeleteResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional deleteExpenseReportResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(deleteExpenseReportResponse, "deleteExpenseReportResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.deleteExpenseReportResponse = deleteExpenseReportResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseReportsDeleteResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Reports + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional deleteExpenseReportResponse() { + return (Optional) deleteExpenseReportResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseReportsDeleteResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseReportsDeleteResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseReportsDeleteResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Reports + */ + public AccountingExpenseReportsDeleteResponse withDeleteExpenseReportResponse(DeleteExpenseReportResponse deleteExpenseReportResponse) { + Utils.checkNotNull(deleteExpenseReportResponse, "deleteExpenseReportResponse"); + this.deleteExpenseReportResponse = Optional.ofNullable(deleteExpenseReportResponse); + return this; + } + + + /** + * Expense Reports + */ + public AccountingExpenseReportsDeleteResponse withDeleteExpenseReportResponse(Optional deleteExpenseReportResponse) { + Utils.checkNotNull(deleteExpenseReportResponse, "deleteExpenseReportResponse"); + this.deleteExpenseReportResponse = deleteExpenseReportResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseReportsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseReportsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsDeleteResponse other = (AccountingExpenseReportsDeleteResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.deleteExpenseReportResponse, other.deleteExpenseReportResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + deleteExpenseReportResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsDeleteResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "deleteExpenseReportResponse", deleteExpenseReportResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional deleteExpenseReportResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Reports + */ + public Builder deleteExpenseReportResponse(DeleteExpenseReportResponse deleteExpenseReportResponse) { + Utils.checkNotNull(deleteExpenseReportResponse, "deleteExpenseReportResponse"); + this.deleteExpenseReportResponse = Optional.ofNullable(deleteExpenseReportResponse); + return this; + } + + /** + * Expense Reports + */ + public Builder deleteExpenseReportResponse(Optional deleteExpenseReportResponse) { + Utils.checkNotNull(deleteExpenseReportResponse, "deleteExpenseReportResponse"); + this.deleteExpenseReportResponse = deleteExpenseReportResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseReportsDeleteResponse build() { + + return new AccountingExpenseReportsDeleteResponse( + contentType, statusCode, rawResponse, + deleteExpenseReportResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsOneRequestBuilder.java new file mode 100644 index 000000000..753debc82 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsOneRequestBuilder.java @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingExpenseReportsOneRequest; +import com.apideck.unify.operations.AccountingExpenseReportsOne; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class AccountingExpenseReportsOneRequestBuilder { + + private AccountingExpenseReportsOneRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseReportsOneRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseReportsOneRequestBuilder request(AccountingExpenseReportsOneRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseReportsOneRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseReportsOneRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingExpenseReportsOne.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsOneResponse.java new file mode 100644 index 000000000..382060c97 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsOneResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.GetExpenseReportResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseReportsOneResponse 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; + + /** + * Expense Reports + */ + private Optional getExpenseReportResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseReportsOneResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional getExpenseReportResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(getExpenseReportResponse, "getExpenseReportResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.getExpenseReportResponse = getExpenseReportResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseReportsOneResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Reports + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional getExpenseReportResponse() { + return (Optional) getExpenseReportResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseReportsOneResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseReportsOneResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseReportsOneResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Reports + */ + public AccountingExpenseReportsOneResponse withGetExpenseReportResponse(GetExpenseReportResponse getExpenseReportResponse) { + Utils.checkNotNull(getExpenseReportResponse, "getExpenseReportResponse"); + this.getExpenseReportResponse = Optional.ofNullable(getExpenseReportResponse); + return this; + } + + + /** + * Expense Reports + */ + public AccountingExpenseReportsOneResponse withGetExpenseReportResponse(Optional getExpenseReportResponse) { + Utils.checkNotNull(getExpenseReportResponse, "getExpenseReportResponse"); + this.getExpenseReportResponse = getExpenseReportResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseReportsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseReportsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsOneResponse other = (AccountingExpenseReportsOneResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.getExpenseReportResponse, other.getExpenseReportResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + getExpenseReportResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsOneResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "getExpenseReportResponse", getExpenseReportResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional getExpenseReportResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Reports + */ + public Builder getExpenseReportResponse(GetExpenseReportResponse getExpenseReportResponse) { + Utils.checkNotNull(getExpenseReportResponse, "getExpenseReportResponse"); + this.getExpenseReportResponse = Optional.ofNullable(getExpenseReportResponse); + return this; + } + + /** + * Expense Reports + */ + public Builder getExpenseReportResponse(Optional getExpenseReportResponse) { + Utils.checkNotNull(getExpenseReportResponse, "getExpenseReportResponse"); + this.getExpenseReportResponse = getExpenseReportResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseReportsOneResponse build() { + + return new AccountingExpenseReportsOneResponse( + contentType, statusCode, rawResponse, + getExpenseReportResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsUpdateRequestBuilder.java new file mode 100644 index 000000000..062b56275 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsUpdateRequestBuilder.java @@ -0,0 +1,60 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.models.operations.AccountingExpenseReportsUpdateRequest; +import com.apideck.unify.operations.AccountingExpenseReportsUpdate; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +public class AccountingExpenseReportsUpdateRequestBuilder { + + private AccountingExpenseReportsUpdateRequest request; + private Optional retryConfig = Optional.empty(); + private final SDKConfiguration sdkConfiguration; + private final Headers _headers = new Headers(); + + public AccountingExpenseReportsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { + this.sdkConfiguration = sdkConfiguration; + } + + public AccountingExpenseReportsUpdateRequestBuilder request(AccountingExpenseReportsUpdateRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; + return this; + } + + public AccountingExpenseReportsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = Optional.of(retryConfig); + return this; + } + + public AccountingExpenseReportsUpdateRequestBuilder retryConfig(Optional retryConfig) { + Utils.checkNotNull(retryConfig, "retryConfig"); + this.retryConfig = retryConfig; + return this; + } + + public CompletableFuture call() { + Optional options = Optional.of(Options.builder() + .retryConfig(retryConfig) + .build()); + + AsyncRequestOperation operation + = new AccountingExpenseReportsUpdate.Async( + sdkConfiguration, options, sdkConfiguration.retryScheduler(), + _headers); + + return operation.doRequest(request) + .thenCompose(operation::handleResponse); + } +} diff --git a/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsUpdateResponse.java new file mode 100644 index 000000000..e80ddaa44 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/operations/async/AccountingExpenseReportsUpdateResponse.java @@ -0,0 +1,313 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.operations.async; + +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.components.UpdateExpenseReportResponse; +import com.apideck.unify.utils.AsyncResponse; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +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 AccountingExpenseReportsUpdateResponse 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; + + /** + * Expense Reports + */ + private Optional updateExpenseReportResponse; + + /** + * Unexpected error + */ + private Optional unexpectedErrorResponse; + + @JsonCreator + public AccountingExpenseReportsUpdateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse, + Optional updateExpenseReportResponse, + Optional unexpectedErrorResponse) { + Utils.checkNotNull(contentType, "contentType"); + Utils.checkNotNull(statusCode, "statusCode"); + Utils.checkNotNull(rawResponse, "rawResponse"); + Utils.checkNotNull(updateExpenseReportResponse, "updateExpenseReportResponse"); + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.contentType = contentType; + this.statusCode = statusCode; + this.rawResponse = rawResponse; + this.updateExpenseReportResponse = updateExpenseReportResponse; + this.unexpectedErrorResponse = unexpectedErrorResponse; + } + + public AccountingExpenseReportsUpdateResponse( + String contentType, + int statusCode, + HttpResponse rawResponse) { + this(contentType, statusCode, rawResponse, + Optional.empty(), 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; + } + + /** + * Expense Reports + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional updateExpenseReportResponse() { + return (Optional) updateExpenseReportResponse; + } + + /** + * Unexpected error + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public Optional unexpectedErrorResponse() { + return (Optional) unexpectedErrorResponse; + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * HTTP response content type for this operation + */ + public AccountingExpenseReportsUpdateResponse withContentType(String contentType) { + Utils.checkNotNull(contentType, "contentType"); + this.contentType = contentType; + return this; + } + + /** + * HTTP response status code for this operation + */ + public AccountingExpenseReportsUpdateResponse withStatusCode(int statusCode) { + Utils.checkNotNull(statusCode, "statusCode"); + this.statusCode = statusCode; + return this; + } + + /** + * Raw HTTP response; suitable for custom response parsing + */ + public AccountingExpenseReportsUpdateResponse withRawResponse(HttpResponse rawResponse) { + Utils.checkNotNull(rawResponse, "rawResponse"); + this.rawResponse = rawResponse; + return this; + } + + /** + * Expense Reports + */ + public AccountingExpenseReportsUpdateResponse withUpdateExpenseReportResponse(UpdateExpenseReportResponse updateExpenseReportResponse) { + Utils.checkNotNull(updateExpenseReportResponse, "updateExpenseReportResponse"); + this.updateExpenseReportResponse = Optional.ofNullable(updateExpenseReportResponse); + return this; + } + + + /** + * Expense Reports + */ + public AccountingExpenseReportsUpdateResponse withUpdateExpenseReportResponse(Optional updateExpenseReportResponse) { + Utils.checkNotNull(updateExpenseReportResponse, "updateExpenseReportResponse"); + this.updateExpenseReportResponse = updateExpenseReportResponse; + return this; + } + + /** + * Unexpected error + */ + public AccountingExpenseReportsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + + /** + * Unexpected error + */ + public AccountingExpenseReportsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountingExpenseReportsUpdateResponse other = (AccountingExpenseReportsUpdateResponse) o; + return + Utils.enhancedDeepEquals(this.contentType, other.contentType) && + Utils.enhancedDeepEquals(this.statusCode, other.statusCode) && + Utils.enhancedDeepEquals(this.rawResponse, other.rawResponse) && + Utils.enhancedDeepEquals(this.updateExpenseReportResponse, other.updateExpenseReportResponse) && + Utils.enhancedDeepEquals(this.unexpectedErrorResponse, other.unexpectedErrorResponse); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + contentType, statusCode, rawResponse, + updateExpenseReportResponse, unexpectedErrorResponse); + } + + @Override + public String toString() { + return Utils.toString(AccountingExpenseReportsUpdateResponse.class, + "contentType", contentType, + "statusCode", statusCode, + "rawResponse", rawResponse, + "updateExpenseReportResponse", updateExpenseReportResponse, + "unexpectedErrorResponse", unexpectedErrorResponse); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private String contentType; + + private Integer statusCode; + + private HttpResponse rawResponse; + + private Optional updateExpenseReportResponse = Optional.empty(); + + private Optional unexpectedErrorResponse = 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; + } + + + /** + * Expense Reports + */ + public Builder updateExpenseReportResponse(UpdateExpenseReportResponse updateExpenseReportResponse) { + Utils.checkNotNull(updateExpenseReportResponse, "updateExpenseReportResponse"); + this.updateExpenseReportResponse = Optional.ofNullable(updateExpenseReportResponse); + return this; + } + + /** + * Expense Reports + */ + public Builder updateExpenseReportResponse(Optional updateExpenseReportResponse) { + Utils.checkNotNull(updateExpenseReportResponse, "updateExpenseReportResponse"); + this.updateExpenseReportResponse = updateExpenseReportResponse; + return this; + } + + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + return this; + } + + /** + * Unexpected error + */ + public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { + Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + this.unexpectedErrorResponse = unexpectedErrorResponse; + return this; + } + + public AccountingExpenseReportsUpdateResponse build() { + + return new AccountingExpenseReportsUpdateResponse( + contentType, statusCode, rawResponse, + updateExpenseReportResponse, unexpectedErrorResponse); + } + + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingEmployeesAdd.java b/src/main/java/com/apideck/unify/operations/AccountingEmployeesAdd.java new file mode 100644 index 000000000..86dc878df --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingEmployeesAdd.java @@ -0,0 +1,418 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.CreateAccountingEmployeeResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingEmployeesAddRequest; +import com.apideck.unify.models.operations.AccountingEmployeesAddResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.SerializedBody; +import com.apideck.unify.utils.Utils.JsonShape; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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.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 AccountingEmployeesAdd { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesAdd", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesAdd", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesAdd", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass, TypeReference typeReference) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/accounting/employees"); + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + typeReference); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "accountingEmployee", + "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))); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingEmployeesAddRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingEmployeesAddRequest.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(AccountingEmployeesAddRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingEmployeesAddResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingEmployeesAddResponse.Builder resBuilder = + AccountingEmployeesAddResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingEmployeesAddResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withCreateAccountingEmployeeResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingEmployeesAddRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingEmployeesAddRequest.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(AccountingEmployeesAddRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingEmployeesAddResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingEmployeesAddResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingEmployeesAddResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withCreateAccountingEmployeeResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingEmployeesAll.java b/src/main/java/com/apideck/unify/operations/AccountingEmployeesAll.java new file mode 100644 index 000000000..777fb6d6e --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingEmployeesAll.java @@ -0,0 +1,401 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.GetAccountingEmployeesResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingEmployeesAllRequest; +import com.apideck.unify.models.operations.AccountingEmployeesAllResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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 AccountingEmployeesAll { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesAll", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesAll", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesAll", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/accounting/employees"); + 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, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingEmployeesAllRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingEmployeesAllRequest.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(AccountingEmployeesAllRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingEmployeesAllResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingEmployeesAllResponse.Builder resBuilder = + AccountingEmployeesAllResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingEmployeesAllResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withGetAccountingEmployeesResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingEmployeesAllRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingEmployeesAllRequest.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(AccountingEmployeesAllRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingEmployeesAllResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingEmployeesAllResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingEmployeesAllResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withGetAccountingEmployeesResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingEmployeesDelete.java b/src/main/java/com/apideck/unify/operations/AccountingEmployeesDelete.java new file mode 100644 index 000000000..bd69675d2 --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingEmployeesDelete.java @@ -0,0 +1,403 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.DeleteAccountingEmployeeResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingEmployeesDeleteRequest; +import com.apideck.unify.models.operations.AccountingEmployeesDeleteResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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 AccountingEmployeesDelete { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesDelete", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesDelete", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesDelete", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/accounting/employees/{id}", + request, this.operationGlobals); + 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))); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingEmployeesDeleteRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingEmployeesDeleteRequest.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(AccountingEmployeesDeleteRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingEmployeesDeleteResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingEmployeesDeleteResponse.Builder resBuilder = + AccountingEmployeesDeleteResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingEmployeesDeleteResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withDeleteAccountingEmployeeResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingEmployeesDeleteRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingEmployeesDeleteRequest.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(AccountingEmployeesDeleteRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingEmployeesDeleteResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingEmployeesDeleteResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingEmployeesDeleteResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withDeleteAccountingEmployeeResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingEmployeesOne.java b/src/main/java/com/apideck/unify/operations/AccountingEmployeesOne.java new file mode 100644 index 000000000..44ac022af --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingEmployeesOne.java @@ -0,0 +1,403 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.GetAccountingEmployeeResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingEmployeesOneRequest; +import com.apideck.unify.models.operations.AccountingEmployeesOneResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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 AccountingEmployeesOne { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesOne", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesOne", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesOne", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/accounting/employees/{id}", + request, this.operationGlobals); + 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, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingEmployeesOneRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingEmployeesOneRequest.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(AccountingEmployeesOneRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingEmployeesOneResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingEmployeesOneResponse.Builder resBuilder = + AccountingEmployeesOneResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingEmployeesOneResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withGetAccountingEmployeeResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingEmployeesOneRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingEmployeesOneRequest.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(AccountingEmployeesOneRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingEmployeesOneResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingEmployeesOneResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingEmployeesOneResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withGetAccountingEmployeeResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingEmployeesUpdate.java b/src/main/java/com/apideck/unify/operations/AccountingEmployeesUpdate.java new file mode 100644 index 000000000..aa69128a9 --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingEmployeesUpdate.java @@ -0,0 +1,420 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.components.UpdateAccountingEmployeeResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingEmployeesUpdateRequest; +import com.apideck.unify.models.operations.AccountingEmployeesUpdateResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.SerializedBody; +import com.apideck.unify.utils.Utils.JsonShape; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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.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 AccountingEmployeesUpdate { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesUpdate", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesUpdate", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.employeesUpdate", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass, TypeReference typeReference) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/accounting/employees/{id}", + request, this.operationGlobals); + HTTPRequest req = new HTTPRequest(url, "PATCH"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + typeReference); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "accountingEmployee", + "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))); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingEmployeesUpdateRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingEmployeesUpdateRequest.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(AccountingEmployeesUpdateRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingEmployeesUpdateResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingEmployeesUpdateResponse.Builder resBuilder = + AccountingEmployeesUpdateResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingEmployeesUpdateResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUpdateAccountingEmployeeResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingEmployeesUpdateRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingEmployeesUpdateRequest.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(AccountingEmployeesUpdateRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingEmployeesUpdateResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingEmployeesUpdateResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingEmployeesUpdateResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUpdateAccountingEmployeeResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesAdd.java b/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesAdd.java new file mode 100644 index 000000000..826c1a5a5 --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesAdd.java @@ -0,0 +1,418 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.CreateExpenseCategoryResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAddRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAddResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.SerializedBody; +import com.apideck.unify.utils.Utils.JsonShape; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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.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 AccountingExpenseCategoriesAdd { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesAdd", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesAdd", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesAdd", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass, TypeReference typeReference) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/accounting/expense-categories"); + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + typeReference); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "expenseCategory", + "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))); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingExpenseCategoriesAddRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseCategoriesAddRequest.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(AccountingExpenseCategoriesAddRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingExpenseCategoriesAddResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingExpenseCategoriesAddResponse.Builder resBuilder = + AccountingExpenseCategoriesAddResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingExpenseCategoriesAddResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withCreateExpenseCategoryResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingExpenseCategoriesAddRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseCategoriesAddRequest.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(AccountingExpenseCategoriesAddRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingExpenseCategoriesAddResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingExpenseCategoriesAddResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingExpenseCategoriesAddResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withCreateExpenseCategoryResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesAll.java b/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesAll.java new file mode 100644 index 000000000..ecdd35367 --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesAll.java @@ -0,0 +1,401 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.GetExpenseCategoriesResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAllRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesAllResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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 AccountingExpenseCategoriesAll { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesAll", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesAll", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesAll", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/accounting/expense-categories"); + 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, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingExpenseCategoriesAllRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseCategoriesAllRequest.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(AccountingExpenseCategoriesAllRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingExpenseCategoriesAllResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingExpenseCategoriesAllResponse.Builder resBuilder = + AccountingExpenseCategoriesAllResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingExpenseCategoriesAllResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withGetExpenseCategoriesResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingExpenseCategoriesAllRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseCategoriesAllRequest.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(AccountingExpenseCategoriesAllRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingExpenseCategoriesAllResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingExpenseCategoriesAllResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingExpenseCategoriesAllResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withGetExpenseCategoriesResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesDelete.java b/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesDelete.java new file mode 100644 index 000000000..2d204cc2f --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesDelete.java @@ -0,0 +1,403 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.DeleteExpenseCategoryResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesDeleteRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesDeleteResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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 AccountingExpenseCategoriesDelete { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesDelete", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesDelete", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesDelete", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/accounting/expense-categories/{id}", + request, this.operationGlobals); + 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))); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingExpenseCategoriesDeleteRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseCategoriesDeleteRequest.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(AccountingExpenseCategoriesDeleteRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingExpenseCategoriesDeleteResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingExpenseCategoriesDeleteResponse.Builder resBuilder = + AccountingExpenseCategoriesDeleteResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingExpenseCategoriesDeleteResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withDeleteExpenseCategoryResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingExpenseCategoriesDeleteRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseCategoriesDeleteRequest.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(AccountingExpenseCategoriesDeleteRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingExpenseCategoriesDeleteResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingExpenseCategoriesDeleteResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingExpenseCategoriesDeleteResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withDeleteExpenseCategoryResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesOne.java b/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesOne.java new file mode 100644 index 000000000..1114c8f77 --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesOne.java @@ -0,0 +1,403 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.GetExpenseCategoryResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesOneRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesOneResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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 AccountingExpenseCategoriesOne { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesOne", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesOne", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesOne", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/accounting/expense-categories/{id}", + request, this.operationGlobals); + 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, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingExpenseCategoriesOneRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseCategoriesOneRequest.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(AccountingExpenseCategoriesOneRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingExpenseCategoriesOneResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingExpenseCategoriesOneResponse.Builder resBuilder = + AccountingExpenseCategoriesOneResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingExpenseCategoriesOneResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withGetExpenseCategoryResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingExpenseCategoriesOneRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseCategoriesOneRequest.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(AccountingExpenseCategoriesOneRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingExpenseCategoriesOneResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingExpenseCategoriesOneResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingExpenseCategoriesOneResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withGetExpenseCategoryResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesUpdate.java b/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesUpdate.java new file mode 100644 index 000000000..30815fc03 --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingExpenseCategoriesUpdate.java @@ -0,0 +1,420 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.components.UpdateExpenseCategoryResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesUpdateRequest; +import com.apideck.unify.models.operations.AccountingExpenseCategoriesUpdateResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.SerializedBody; +import com.apideck.unify.utils.Utils.JsonShape; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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.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 AccountingExpenseCategoriesUpdate { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesUpdate", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesUpdate", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseCategoriesUpdate", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass, TypeReference typeReference) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/accounting/expense-categories/{id}", + request, this.operationGlobals); + HTTPRequest req = new HTTPRequest(url, "PATCH"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + typeReference); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "expenseCategory", + "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))); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingExpenseCategoriesUpdateRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseCategoriesUpdateRequest.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(AccountingExpenseCategoriesUpdateRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingExpenseCategoriesUpdateResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingExpenseCategoriesUpdateResponse.Builder resBuilder = + AccountingExpenseCategoriesUpdateResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingExpenseCategoriesUpdateResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUpdateExpenseCategoryResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingExpenseCategoriesUpdateRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseCategoriesUpdateRequest.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(AccountingExpenseCategoriesUpdateRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingExpenseCategoriesUpdateResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingExpenseCategoriesUpdateResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingExpenseCategoriesUpdateResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUpdateExpenseCategoryResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsAdd.java b/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsAdd.java new file mode 100644 index 000000000..abc3ae0b2 --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsAdd.java @@ -0,0 +1,418 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.CreateExpenseReportResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingExpenseReportsAddRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsAddResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.SerializedBody; +import com.apideck.unify.utils.Utils.JsonShape; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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.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 AccountingExpenseReportsAdd { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsAdd", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsAdd", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsAdd", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass, TypeReference typeReference) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/accounting/expense-reports"); + HTTPRequest req = new HTTPRequest(url, "POST"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + typeReference); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "expenseReport", + "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))); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingExpenseReportsAddRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseReportsAddRequest.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(AccountingExpenseReportsAddRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingExpenseReportsAddResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingExpenseReportsAddResponse.Builder resBuilder = + AccountingExpenseReportsAddResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingExpenseReportsAddResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withCreateExpenseReportResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingExpenseReportsAddRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseReportsAddRequest.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(AccountingExpenseReportsAddRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingExpenseReportsAddResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingExpenseReportsAddResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingExpenseReportsAddResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "201")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withCreateExpenseReportResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsAll.java b/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsAll.java new file mode 100644 index 000000000..c1fb75389 --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsAll.java @@ -0,0 +1,401 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.GetExpenseReportsResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingExpenseReportsAllRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsAllResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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 AccountingExpenseReportsAll { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsAll", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsAll", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsAll", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + this.baseUrl, + "/accounting/expense-reports"); + 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, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingExpenseReportsAllRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseReportsAllRequest.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(AccountingExpenseReportsAllRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingExpenseReportsAllResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingExpenseReportsAllResponse.Builder resBuilder = + AccountingExpenseReportsAllResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingExpenseReportsAllResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withGetExpenseReportsResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingExpenseReportsAllRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseReportsAllRequest.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(AccountingExpenseReportsAllRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingExpenseReportsAllResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingExpenseReportsAllResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingExpenseReportsAllResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withGetExpenseReportsResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsDelete.java b/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsDelete.java new file mode 100644 index 000000000..ae2217ab9 --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsDelete.java @@ -0,0 +1,403 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.DeleteExpenseReportResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingExpenseReportsDeleteRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsDeleteResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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 AccountingExpenseReportsDelete { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsDelete", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsDelete", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsDelete", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/accounting/expense-reports/{id}", + request, this.operationGlobals); + 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))); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingExpenseReportsDeleteRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseReportsDeleteRequest.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(AccountingExpenseReportsDeleteRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingExpenseReportsDeleteResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingExpenseReportsDeleteResponse.Builder resBuilder = + AccountingExpenseReportsDeleteResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingExpenseReportsDeleteResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withDeleteExpenseReportResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingExpenseReportsDeleteRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseReportsDeleteRequest.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(AccountingExpenseReportsDeleteRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingExpenseReportsDeleteResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingExpenseReportsDeleteResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingExpenseReportsDeleteResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withDeleteExpenseReportResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsOne.java b/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsOne.java new file mode 100644 index 000000000..c521e6f3b --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsOne.java @@ -0,0 +1,403 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.GetExpenseReportResponse; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingExpenseReportsOneRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsOneResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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 AccountingExpenseReportsOne { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsOne", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsOne", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsOne", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/accounting/expense-reports/{id}", + request, this.operationGlobals); + 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, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingExpenseReportsOneRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseReportsOneRequest.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(AccountingExpenseReportsOneRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingExpenseReportsOneResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingExpenseReportsOneResponse.Builder resBuilder = + AccountingExpenseReportsOneResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingExpenseReportsOneResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withGetExpenseReportResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingExpenseReportsOneRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseReportsOneRequest.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(AccountingExpenseReportsOneRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingExpenseReportsOneResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingExpenseReportsOneResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingExpenseReportsOneResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withGetExpenseReportResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +} diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsUpdate.java b/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsUpdate.java new file mode 100644 index 000000000..b437539bd --- /dev/null +++ b/src/main/java/com/apideck/unify/operations/AccountingExpenseReportsUpdate.java @@ -0,0 +1,420 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.operations; + +import static com.apideck.unify.operations.Operations.RequestOperation; +import static com.apideck.unify.utils.Exceptions.unchecked; +import static com.apideck.unify.operations.Operations.AsyncRequestOperation; + +import com.apideck.unify.SDKConfiguration; +import com.apideck.unify.SecuritySource; +import com.apideck.unify.models.components.UnexpectedErrorResponse; +import com.apideck.unify.models.components.UpdateExpenseReportResponse; +import com.apideck.unify.models.errors.APIException; +import com.apideck.unify.models.errors.BadRequestResponse; +import com.apideck.unify.models.errors.NotFoundResponse; +import com.apideck.unify.models.errors.PaymentRequiredResponse; +import com.apideck.unify.models.errors.UnauthorizedResponse; +import com.apideck.unify.models.errors.UnprocessableResponse; +import com.apideck.unify.models.operations.AccountingExpenseReportsUpdateRequest; +import com.apideck.unify.models.operations.AccountingExpenseReportsUpdateResponse; +import com.apideck.unify.utils.AsyncRetries; +import com.apideck.unify.utils.BackoffStrategy; +import com.apideck.unify.utils.Blob; +import com.apideck.unify.utils.Globals; +import com.apideck.unify.utils.HTTPClient; +import com.apideck.unify.utils.HTTPRequest; +import com.apideck.unify.utils.Headers; +import com.apideck.unify.utils.Hook.AfterErrorContextImpl; +import com.apideck.unify.utils.Hook.AfterSuccessContextImpl; +import com.apideck.unify.utils.Hook.BeforeRequestContextImpl; +import com.apideck.unify.utils.NonRetryableException; +import com.apideck.unify.utils.Options; +import com.apideck.unify.utils.Retries; +import com.apideck.unify.utils.RetryConfig; +import com.apideck.unify.utils.SerializedBody; +import com.apideck.unify.utils.Utils.JsonShape; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.core.type.TypeReference; +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.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 AccountingExpenseReportsUpdate { + + 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; + final Globals operationGlobals; + + public Base( + SDKConfiguration sdkConfiguration, Optional options, + Headers _headers) { + this.sdkConfiguration = sdkConfiguration; + this._headers =_headers; + this.baseUrl = this.sdkConfiguration.serverUrl(); + this.securitySource = this.sdkConfiguration.securitySource(); + options + .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); + this.retryStatusCodes = List.of("408", "500", "502", "503", "504"); + this.retryConfig = options + .flatMap(Options::retryConfig) + .or(sdkConfiguration::retryConfig) + .orElse(RetryConfig.builder().backoff(BackoffStrategy.builder() + .initialInterval(500, TimeUnit.MILLISECONDS) + .maxInterval(60000, TimeUnit.MILLISECONDS) + .baseFactor((double) (1.5)) + .maxElapsedTime(900000, TimeUnit.MILLISECONDS) + .retryConnectError(true) + .build()) + .build()); + this.client = this.sdkConfiguration.client(); + this.operationGlobals = new Globals(); + this.sdkConfiguration.globals.getParam("header", "x-apideck-consumer-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-consumer-id", param)); + this.sdkConfiguration.globals.getParam("header", "x-apideck-app-id") + .ifPresent(param -> operationGlobals.putParam("header", "x-apideck-app-id", param)); + } + + Optional securitySource() { + return Optional.ofNullable(this.securitySource); + } + + BeforeRequestContextImpl createBeforeRequestContext() { + return new BeforeRequestContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsUpdate", + java.util.Optional.empty(), + securitySource()); + } + + AfterSuccessContextImpl createAfterSuccessContext() { + return new AfterSuccessContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsUpdate", + java.util.Optional.empty(), + securitySource()); + } + + AfterErrorContextImpl createAfterErrorContext() { + return new AfterErrorContextImpl( + this.sdkConfiguration, + this.baseUrl, + "accounting.expenseReportsUpdate", + java.util.Optional.empty(), + securitySource()); + } + HttpRequest buildRequest(T request, Class klass, TypeReference typeReference) throws Exception { + String url = Utils.generateURL( + klass, + this.baseUrl, + "/accounting/expense-reports/{id}", + request, this.operationGlobals); + HTTPRequest req = new HTTPRequest(url, "PATCH"); + Object convertedRequest = Utils.convertToShape( + request, + JsonShape.DEFAULT, + typeReference); + SerializedBody serializedRequestBody = Utils.serializeRequestBody( + convertedRequest, + "expenseReport", + "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))); + + req.addQueryParams(Utils.getQueryParams( + klass, + request, + this.operationGlobals)); + req.addHeaders(Utils.getHeadersFromMetadata(request, this.operationGlobals)); + 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(AccountingExpenseReportsUpdateRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseReportsUpdateRequest.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(AccountingExpenseReportsUpdateRequest request) { + Retries retries = Retries.builder() + .action(() -> { + HttpRequest r; + try { + r = onBuildRequest(request); + } catch (Exception e) { + throw new NonRetryableException(e); + } + try { + HttpResponse httpRes = client.send(r); + if (Utils.statusCodeMatches(httpRes.statusCode(), "400", "401", "402", "404", "422", "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 AccountingExpenseReportsUpdateResponse handleResponse(HttpResponse response) { + String contentType = response + .headers() + .firstValue("Content-Type") + .orElse("application/octet-stream"); + AccountingExpenseReportsUpdateResponse.Builder resBuilder = + AccountingExpenseReportsUpdateResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + AccountingExpenseReportsUpdateResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUpdateExpenseReportResponse(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 BadRequestResponse.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 UnauthorizedResponse.from(response); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, response); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + throw PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return res.withUnexpectedErrorResponse(Utils.unmarshal(response, new TypeReference() {})); + } else { + throw APIException.from("Unexpected content-type received: " + contentType, 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(AccountingExpenseReportsUpdateRequest request) throws Exception { + HttpRequest req = buildRequest(request, AccountingExpenseReportsUpdateRequest.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(AccountingExpenseReportsUpdateRequest request) { + AsyncRetries retries = AsyncRetries.builder() + .retryConfig(retryConfig) + .statusCodes(retryStatusCodes) + .scheduler(retryScheduler) + .build(); + return retries.retry(() -> unchecked(() -> onBuildRequest(request)).get().thenCompose(client::sendAsync) + .handle((resp, err) -> { + if (err != null) { + return onError(null, err); + } + if (Utils.statusCodeMatches(resp.statusCode(), "400", "401", "402", "404", "422", "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.apideck.unify.models.operations.async.AccountingExpenseReportsUpdateResponse.Builder resBuilder = + com.apideck.unify.models.operations.async.AccountingExpenseReportsUpdateResponse + .builder() + .contentType(contentType) + .statusCode(response.statusCode()) + .rawResponse(response); + + com.apideck.unify.models.operations.async.AccountingExpenseReportsUpdateResponse res = resBuilder.build(); + + if (Utils.statusCodeMatches(response.statusCode(), "200")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUpdateExpenseReportResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "400")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return BadRequestResponse.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 UnauthorizedResponse.fromAsync(response) + .thenCompose(CompletableFuture::failedFuture); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + if (Utils.statusCodeMatches(response.statusCode(), "402")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return PaymentRequiredResponse.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 NotFoundResponse.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 UnprocessableResponse.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"); + } + if (Utils.statusCodeMatches(response.statusCode(), "default")) { + if (Utils.contentTypeMatches(contentType, "application/json")) { + return Utils.unmarshalAsync(response, new TypeReference() {}) + .thenApply(res::withUnexpectedErrorResponse); + } else { + return Utils.createAsyncApiError(response, "Unexpected content-type received: " + contentType); + } + } + return Utils.createAsyncApiError(response, "Unexpected status code received: " + response.statusCode()); + } + } +}