From 9cd9736b2cd4c0f82709ed793772e0aae36eca2e Mon Sep 17 00:00:00 2001 From: Maksym Novozhylov Date: Tue, 6 Nov 2018 12:02:55 +0100 Subject: [PATCH] Initial commit --- .docgen | 1 + .gitignore | 3 + .travis.yml | 16 + Build.PL | 61 ++++ CHANGES.md | 26 ++ LICENSE | 176 ++++++++++ MANIFEST | 125 +++++++ README.md | 74 ++++ example/example.pl | 57 ++++ lib/Net/Upwork/API.pm | 217 ++++++++++++ lib/Net/Upwork/API/Client.pm | 290 ++++++++++++++++ lib/Net/Upwork/API/Config.pm | 77 +++++ .../API/Routers/Activities/Engagement.pm | 150 ++++++++ lib/Net/Upwork/API/Routers/Activities/Team.pm | 323 ++++++++++++++++++ lib/Net/Upwork/API/Routers/Auth.pm | 78 +++++ .../Upwork/API/Routers/Freelancers/Profile.pm | 107 ++++++ .../Upwork/API/Routers/Freelancers/Search.pm | 84 +++++ .../API/Routers/Hr/Clients/Applications.pm | 112 ++++++ .../Upwork/API/Routers/Hr/Clients/Offers.pm | 135 ++++++++ lib/Net/Upwork/API/Routers/Hr/Contracts.pm | 145 ++++++++ lib/Net/Upwork/API/Routers/Hr/Engagements.pm | 107 ++++++ .../Routers/Hr/Freelancers/Applications.pm | 112 ++++++ .../API/Routers/Hr/Freelancers/Offers.pm | 140 ++++++++ lib/Net/Upwork/API/Routers/Hr/Interviews.pm | 89 +++++ lib/Net/Upwork/API/Routers/Hr/Jobs.pm | 186 ++++++++++ lib/Net/Upwork/API/Routers/Hr/Milestones.pm | 237 +++++++++++++ lib/Net/Upwork/API/Routers/Hr/Roles.pm | 100 ++++++ lib/Net/Upwork/API/Routers/Hr/Submissions.pm | 140 ++++++++ lib/Net/Upwork/API/Routers/Jobs/Profile.pm | 84 +++++ lib/Net/Upwork/API/Routers/Jobs/Search.pm | 84 +++++ lib/Net/Upwork/API/Routers/Messages.pm | 231 +++++++++++++ lib/Net/Upwork/API/Routers/Metadata.pm | 148 ++++++++ .../API/Routers/Organization/Companies.pm | 146 ++++++++ .../Upwork/API/Routers/Organization/Teams.pm | 100 ++++++ .../Upwork/API/Routers/Organization/Users.pm | 100 ++++++ lib/Net/Upwork/API/Routers/Payments.pm | 89 +++++ .../API/Routers/Reports/Finance/Accounts.pm | 109 ++++++ .../API/Routers/Reports/Finance/Billings.pm | 181 ++++++++++ .../API/Routers/Reports/Finance/Earnings.pm | 181 ++++++++++ lib/Net/Upwork/API/Routers/Reports/Time.pm | 273 +++++++++++++++ lib/Net/Upwork/API/Routers/Snapshot.pm | 150 ++++++++ lib/Net/Upwork/API/Routers/Workdays.pm | 137 ++++++++ lib/Net/Upwork/API/Routers/Workdiary.pm | 94 +++++ t/0-signature.t | 28 ++ t/00.load.t | 34 ++ t/01.core_packages.t | 27 ++ t/02.routers_auth.t | 8 + t/03.routers_messages.t | 16 + t/04.routers_snapshot.t | 10 + t/05.routers_metadata.t | 12 + t/06.routers_payments.t | 8 + t/07.routers_workdays.t | 9 + t/08.routers_workdiary.t | 8 + t/09.routers_activities_engagement.t | 10 + t/10.routers_activities_team.t | 16 + t/11.routers_freelancers_profile.t | 9 + t/12.routers_freelancers_search.t | 8 + t/13.routers_jobs_profile.t | 8 + t/14.routers_jobs_search.t | 8 + t/15.routers_organization_companies.t | 11 + t/16.routers_organization_teams.t | 9 + t/17.routers_organization_users.t | 9 + t/18.routers_hr_contracts.t | 10 + t/19.routers_hr_engagements.t | 9 + t/20.routers_hr_interviews.t | 8 + t/21.routers_hr_jobs.t | 12 + t/22.routers_hr_milestones.t | 14 + t/23.routers_hr_submissions.t | 10 + t/24.routers_hr_clients_applications.t | 9 + t/25.routers_hr_clients_offers.t | 10 + t/26.routers_hr_freelancers_offers.t | 9 + t/27.routers_hr_freelancers_applications.t | 10 + t/28.routers_reports_time.t | 15 + t/29.routers_reports_finance_accounts.t | 9 + t/30.routers_reports_finance_billings.t | 12 + t/31.routers_reports_finance_earnings.t | 12 + 76 files changed, 5872 insertions(+) create mode 100644 .docgen create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 Build.PL create mode 100644 CHANGES.md create mode 100644 LICENSE create mode 100644 MANIFEST create mode 100644 README.md create mode 100644 example/example.pl create mode 100644 lib/Net/Upwork/API.pm create mode 100644 lib/Net/Upwork/API/Client.pm create mode 100644 lib/Net/Upwork/API/Config.pm create mode 100644 lib/Net/Upwork/API/Routers/Activities/Engagement.pm create mode 100644 lib/Net/Upwork/API/Routers/Activities/Team.pm create mode 100644 lib/Net/Upwork/API/Routers/Auth.pm create mode 100644 lib/Net/Upwork/API/Routers/Freelancers/Profile.pm create mode 100644 lib/Net/Upwork/API/Routers/Freelancers/Search.pm create mode 100644 lib/Net/Upwork/API/Routers/Hr/Clients/Applications.pm create mode 100644 lib/Net/Upwork/API/Routers/Hr/Clients/Offers.pm create mode 100644 lib/Net/Upwork/API/Routers/Hr/Contracts.pm create mode 100644 lib/Net/Upwork/API/Routers/Hr/Engagements.pm create mode 100644 lib/Net/Upwork/API/Routers/Hr/Freelancers/Applications.pm create mode 100644 lib/Net/Upwork/API/Routers/Hr/Freelancers/Offers.pm create mode 100644 lib/Net/Upwork/API/Routers/Hr/Interviews.pm create mode 100644 lib/Net/Upwork/API/Routers/Hr/Jobs.pm create mode 100644 lib/Net/Upwork/API/Routers/Hr/Milestones.pm create mode 100644 lib/Net/Upwork/API/Routers/Hr/Roles.pm create mode 100644 lib/Net/Upwork/API/Routers/Hr/Submissions.pm create mode 100644 lib/Net/Upwork/API/Routers/Jobs/Profile.pm create mode 100644 lib/Net/Upwork/API/Routers/Jobs/Search.pm create mode 100644 lib/Net/Upwork/API/Routers/Messages.pm create mode 100644 lib/Net/Upwork/API/Routers/Metadata.pm create mode 100644 lib/Net/Upwork/API/Routers/Organization/Companies.pm create mode 100644 lib/Net/Upwork/API/Routers/Organization/Teams.pm create mode 100644 lib/Net/Upwork/API/Routers/Organization/Users.pm create mode 100644 lib/Net/Upwork/API/Routers/Payments.pm create mode 100644 lib/Net/Upwork/API/Routers/Reports/Finance/Accounts.pm create mode 100644 lib/Net/Upwork/API/Routers/Reports/Finance/Billings.pm create mode 100644 lib/Net/Upwork/API/Routers/Reports/Finance/Earnings.pm create mode 100644 lib/Net/Upwork/API/Routers/Reports/Time.pm create mode 100644 lib/Net/Upwork/API/Routers/Snapshot.pm create mode 100644 lib/Net/Upwork/API/Routers/Workdays.pm create mode 100644 lib/Net/Upwork/API/Routers/Workdiary.pm create mode 100644 t/0-signature.t create mode 100644 t/00.load.t create mode 100644 t/01.core_packages.t create mode 100644 t/02.routers_auth.t create mode 100644 t/03.routers_messages.t create mode 100644 t/04.routers_snapshot.t create mode 100644 t/05.routers_metadata.t create mode 100644 t/06.routers_payments.t create mode 100644 t/07.routers_workdays.t create mode 100644 t/08.routers_workdiary.t create mode 100644 t/09.routers_activities_engagement.t create mode 100644 t/10.routers_activities_team.t create mode 100644 t/11.routers_freelancers_profile.t create mode 100644 t/12.routers_freelancers_search.t create mode 100644 t/13.routers_jobs_profile.t create mode 100644 t/14.routers_jobs_search.t create mode 100644 t/15.routers_organization_companies.t create mode 100644 t/16.routers_organization_teams.t create mode 100644 t/17.routers_organization_users.t create mode 100644 t/18.routers_hr_contracts.t create mode 100644 t/19.routers_hr_engagements.t create mode 100644 t/20.routers_hr_interviews.t create mode 100644 t/21.routers_hr_jobs.t create mode 100644 t/22.routers_hr_milestones.t create mode 100644 t/23.routers_hr_submissions.t create mode 100644 t/24.routers_hr_clients_applications.t create mode 100644 t/25.routers_hr_clients_offers.t create mode 100644 t/26.routers_hr_freelancers_offers.t create mode 100644 t/27.routers_hr_freelancers_applications.t create mode 100644 t/28.routers_reports_time.t create mode 100644 t/29.routers_reports_finance_accounts.t create mode 100644 t/30.routers_reports_finance_billings.t create mode 100644 t/31.routers_reports_finance_earnings.t diff --git a/.docgen b/.docgen new file mode 100644 index 0000000..fd27d58 --- /dev/null +++ b/.docgen @@ -0,0 +1 @@ +perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go lib html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b763a6a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/vendor +*~ +composer.lock diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..3d08b5e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: perl +perl: + - "5.20" + - "5.20-shrplib" + - "5.18" + - "5.18-shrplib" + - "5.16" + - "5.14" + - "5.12" + - "5.10" + - "5.8" +notifications: + email: + recipients: + - apisupport@upwork.com + on_failure: change diff --git a/Build.PL b/Build.PL new file mode 100644 index 0000000..18f265d --- /dev/null +++ b/Build.PL @@ -0,0 +1,61 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +use 5.008003; +use strict; +use warnings; +use Module::Build; + +shift(@ARGV) if defined $ARGV[0] and $ARGV[0] eq 'Build'; # accomodate with CPAN autoinstall + +my $builder = Module::Build->new( + (sign => 1), + module_name => 'Net::Upwork::API', + license => 'apache', + dist_author => 'Maksym Novozhylov ', + dist_version => '2.0.0', + dist_abstract => 'Perl bindings for Upwork API (OAuth2)', + build_requires => { + 'Test::More' => '0.66', + 'Test::Warn' => '0.21', + }, + requires => { + 'IO::Socket::SSL' => '1.965', + 'Net::OAuth2' => '0.63', + }, + meta_merge => { keywords => [qw( upwork oauth2 )], }, + meta_add => { + resources => { + homepage => 'http://developers.upwork.com', + repository => 'https://github.com/upwork/perl-upwork.git', + bugtracker => 'https://github.com/upwork/perl-upwork/issues', + }, + }, + add_to_cleanup => [ 'Net-Upwork-API-*' ], + create_makefile_pl => 'passthrough', +); + +$builder->create_build_script(); + +__END__ +# handy lister of installed dependency versions +use Data::Dumper; +my $requires = $builder->build_requires; +for my $mod (keys %$requires) { + eval "require $mod"; + $requires->{$mod} = eval "\$$mod\::VERSION"; +} +print "Current dependency versions:\n"; +print Dumper $requires; diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 0000000..8865526 --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,26 @@ +## 2.0.0 +* OAuth2 release + +## 1.2.2 +* Applications API has moved from v3 to v4 + +## 1.2.2 +* Applications API has moved from v3 to v4 + +## 1.2.1 +* Bug fixes in Messages and Submissions API + +## 1.2.0 +* Added Messages API (new) +* Message API (V1) is now fully depricated + +## 1.1.1 +* Add optional parameter to support pagination in get_tray_by_type +* Fixed issue in Jobs::Search API + +## 1.1.0 +* Get Categories (V1) is now fully depricated +* Added new Activities API - Assign to specific engagement the list of activities + +## 1.0.0 +* welcome to Upwork! diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d9a10c0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..6ed227a --- /dev/null +++ b/MANIFEST @@ -0,0 +1,125 @@ +.docgen +.tests +.travis.yml +Build.PL +CHANGES.md +example/myapp.pl +html/_blkbluw.css +html/_blkcynw.css +html/_blkgrng.css +html/_blkmagw.css +html/_grygrnk.css +html/_grygrnw.css +html/_podly.js +html/_whtgrng.css +html/_whtnavk.css +html/_whtprpk.css +html/_whtpurk.css +html/index.html +html/Net/Upwork/API.html +html/Net/Upwork/API/Client.html +html/Net/Upwork/API/Config.html +html/Net/Upwork/API/Routers/Activities/Engagement.html +html/Net/Upwork/API/Routers/Activities/Team.html +html/Net/Upwork/API/Routers/Auth.html +html/Net/Upwork/API/Routers/Freelancers/Profile.html +html/Net/Upwork/API/Routers/Freelancers/Search.html +html/Net/Upwork/API/Routers/Hr/Clients/Applications.html +html/Net/Upwork/API/Routers/Hr/Clients/Offers.html +html/Net/Upwork/API/Routers/Hr/Contracts.html +html/Net/Upwork/API/Routers/Hr/Engagements.html +html/Net/Upwork/API/Routers/Hr/Freelancers/Applications.html +html/Net/Upwork/API/Routers/Hr/Freelancers/Offers.html +html/Net/Upwork/API/Routers/Hr/Interviews.html +html/Net/Upwork/API/Routers/Hr/Jobs.html +html/Net/Upwork/API/Routers/Hr/Milestones.html +html/Net/Upwork/API/Routers/Hr/Roles.html +html/Net/Upwork/API/Routers/Hr/Submissions.html +html/Net/Upwork/API/Routers/Jobs/Profile.html +html/Net/Upwork/API/Routers/Jobs/Search.html +html/Net/Upwork/API/Routers/Messages.html +html/Net/Upwork/API/Routers/Metadata.html +html/Net/Upwork/API/Routers/Organization/Companies.html +html/Net/Upwork/API/Routers/Organization/Teams.html +html/Net/Upwork/API/Routers/Organization/Users.html +html/Net/Upwork/API/Routers/Payments.html +html/Net/Upwork/API/Routers/Reports/Finance/Accounts.html +html/Net/Upwork/API/Routers/Reports/Finance/Billings.html +html/Net/Upwork/API/Routers/Reports/Finance/Earnings.html +html/Net/Upwork/API/Routers/Reports/Time.html +html/Net/Upwork/API/Routers/Snapshot.html +html/Net/Upwork/API/Routers/Workdays.html +html/Net/Upwork/API/Routers/Workdiary.html +lib/Net/Upwork/API.pm +lib/Net/Upwork/API/Client.pm +lib/Net/Upwork/API/Config.pm +lib/Net/Upwork/API/Routers/Activities/Engagement.pm +lib/Net/Upwork/API/Routers/Activities/Team.pm +lib/Net/Upwork/API/Routers/Auth.pm +lib/Net/Upwork/API/Routers/Freelancers/Profile.pm +lib/Net/Upwork/API/Routers/Freelancers/Search.pm +lib/Net/Upwork/API/Routers/Hr/Clients/Applications.pm +lib/Net/Upwork/API/Routers/Hr/Clients/Offers.pm +lib/Net/Upwork/API/Routers/Hr/Contracts.pm +lib/Net/Upwork/API/Routers/Hr/Engagements.pm +lib/Net/Upwork/API/Routers/Hr/Freelancers/Applications.pm +lib/Net/Upwork/API/Routers/Hr/Freelancers/Offers.pm +lib/Net/Upwork/API/Routers/Hr/Interviews.pm +lib/Net/Upwork/API/Routers/Hr/Jobs.pm +lib/Net/Upwork/API/Routers/Hr/Milestones.pm +lib/Net/Upwork/API/Routers/Hr/Roles.pm +lib/Net/Upwork/API/Routers/Hr/Submissions.pm +lib/Net/Upwork/API/Routers/Jobs/Profile.pm +lib/Net/Upwork/API/Routers/Jobs/Search.pm +lib/Net/Upwork/API/Routers/Messages.pm +lib/Net/Upwork/API/Routers/Metadata.pm +lib/Net/Upwork/API/Routers/Organization/Companies.pm +lib/Net/Upwork/API/Routers/Organization/Teams.pm +lib/Net/Upwork/API/Routers/Organization/Users.pm +lib/Net/Upwork/API/Routers/Payments.pm +lib/Net/Upwork/API/Routers/Reports/Finance/Accounts.pm +lib/Net/Upwork/API/Routers/Reports/Finance/Billings.pm +lib/Net/Upwork/API/Routers/Reports/Finance/Earnings.pm +lib/Net/Upwork/API/Routers/Reports/Time.pm +lib/Net/Upwork/API/Routers/Snapshot.pm +lib/Net/Upwork/API/Routers/Workdays.pm +lib/Net/Upwork/API/Routers/Workdiary.pm +LICENSE +Makefile.PL +MANIFEST This list of files +META.json +META.yml +README.md +t/0-signature.t +t/00.load.t +t/01.core_packages.t +t/02.routers_auth.t +t/03.routers_messages.t +t/04.routers_snapshot.t +t/05.routers_metadata.t +t/06.routers_payments.t +t/07.routers_workdays.t +t/08.routers_workdiary.t +t/09.routers_activities_engagement.t +t/10.routers_activities_team.t +t/11.routers_freelancers_profile.t +t/12.routers_freelancers_search.t +t/13.routers_jobs_profile.t +t/14.routers_jobs_search.t +t/15.routers_organization_companies.t +t/16.routers_organization_teams.t +t/17.routers_organization_users.t +t/18.routers_hr_contracts.t +t/19.routers_hr_engagements.t +t/20.routers_hr_interviews.t +t/21.routers_hr_jobs.t +t/22.routers_hr_milestones.t +t/23.routers_hr_submissions.t +t/24.routers_hr_clients_applications.t +t/25.routers_hr_clients_offers.t +t/26.routers_hr_freelancers_offers.t +t/27.routers_hr_freelancers_applications.t +t/28.routers_reports_time.t +t/29.routers_reports_finance_accounts.t +t/30.routers_reports_finance_billings.t +t/31.routers_reports_finance_earnings.t diff --git a/README.md b/README.md new file mode 100644 index 0000000..4ff49c8 --- /dev/null +++ b/README.md @@ -0,0 +1,74 @@ +Perl bindings for Upwork API (OAuth2) +============ + +[![License](http://img.shields.io/packagist/l/upwork/php-upwork.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) +[![CPAN](https://img.shields.io/cpan/v/Net-Upwork-API.svg)](https://metacpan.org/pod/Net::Upwork::API) +[![GitHub release](https://img.shields.io/github/release/upwork/perl-upwork.svg)](https://github.com/upwork/perl-upwork/releases) +[![Build Status](https://travis-ci.org/upwork/perl-upwork.svg)](https://travis-ci.org/upwork/perl-upwork) + +# Introduction +This project provides a set of resources of Upwork API from http://developers.upwork.com + based on OAuth 2.0. + +# Features +These are the supported API resources: + +* My Info +* Custom Payments +* Hiring +* Job and Freelancer Profile +* Search Jobs and Freelancers +* Organization +* Messages +* Time and Financial Reporting +* Metadata +* Snapshot +* Team +* Workd Diary +* Activities + +# License + +Copyright 2015 Upwork Corporation. All Rights Reserved. + +perl-upwork is licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +## SLA +The usage of this API is ruled by the Terms of Use at: + + https://developers.upwork.com/api-tos.html + +# Application Integration +To integrate this library you need to have: + +* Perl >= 5.008003 +* CPAN + +## Example +In addition to this, a full example is available in the `example` directory. +This includes `example.pl` that gets an access token and requests the data +for applications that are not web-based applications. + +## Installation +1. +Start `cpan` + +2. +Run the following command to install API: +``` +cpan> install Net::Upwork::API +``` + +3. +open `example.pl` and type the clientId (a.k.a. consumer key), clientSecret (a.k.a. client secret) and `redirectUri` that you previously got from the API Center +***That's all. Run your app as `perl example.pl` and have fun.*** diff --git a/example/example.pl b/example/example.pl new file mode 100644 index 0000000..d5502dc --- /dev/null +++ b/example/example.pl @@ -0,0 +1,57 @@ +#!/usr/bin/env perl +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2018(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +use lib "./lib"; # UPDATE IF NEEDED +use Data::Dumper; +use Net::Upwork::API; +use Net::Upwork::API::Routers::Auth; + +$config = Net::Upwork::API::Config->new( + 'client_id' => 'xxxxxxxx', + 'client_secret' => 'xxxxxxxx', + 'redirect_uri' => 'https://your-call-back-url.here', +# 'access_token' => 'xxxxxxxx', +# 'refresh_token' => 'xxxxxxxx', +# 'expires_in' => 86399 # TTL. `expires_at` should be enough for basic usage but you may find this option useful for own needs +# 'expires_at' => 1234567890 # timestamp, either get from the Net::OAuth2::AccessToken object or set like time()+actual_expires_in +); + +$api = Net::Upwork::API->new($config); +if (!$api->has_access_token()) { + my $authz_url = $api->get_authorization_url(); + + print "Visit the authorization url and provide oauth_verifier for further authorization\n"; + print $authz_url . "\n"; + $| = ""; + $code = ; + + my $session = $api->get_access_token($code); + #print Dumper $session; # Net::OAuth2::AccessToken object + #print Dumper $session->access_token; + #print Dumper $session->refresh_token; + #print Dumper $session->expires_in; + # store access token data in safe place! +} else { + $session = $api->set_access_token_session(); + #print Dumper $session; # Net::OAuth2::AccessToken object + # + # WARNING: set_access_token_session() will refresh the access token for you + # in case it's expired, i.e. expires_at < time(). Make sure you replace the + # old token accordingly in your security storage. +} + +$auth = Net::Upwork::API::Routers::Auth->new($api); +$data = $auth->get_user_info(); + +print Dumper $data; diff --git a/lib/Net/Upwork/API.pm b/lib/Net/Upwork/API.pm new file mode 100644 index 0000000..3f8fa16 --- /dev/null +++ b/lib/Net/Upwork/API.pm @@ -0,0 +1,217 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API; + +use strict; +use warnings; + +use Net::Upwork::API::Config; +use Net::Upwork::API::Client; + +our $VERSION = '2.0.0'; + +use constant TOKEN_TYPE_BEARER => 'Bearer'; + +=pod + +=head1 NAME + +API + +=head1 FUNCTIONS + +=over 4 + +=item new($config) + +Create a new Config + +B + +$config + + Config object + +=cut + +sub new { + my $class = shift; + my $config = shift; + my %opts = @_; + $opts{config} = $config; + + my $client = Net::Upwork::API::Client->new($config); + $opts{client} = $client; + + my $self = bless \%opts, $class; + + return $self; +} + +=item init_router + + Initialize router + +B + +$class + + Class + +$api + + API object + +$epoint + + Entry point for the router + +B + + Object + +=cut + +sub init_router { + my $class = shift; + my $api = shift; + my $epoint = shift; + my %opts = @_; + + $opts{client} = $api->{client}; + $opts{client}{epoint} = $epoint; + my $self = bless \%opts, $class; + + return $self; +} + +=item get_access_token() + + Get access token key/secret pair + +B + +$code + + Authorization Code, see https://tools.ietf.org/html/rfc6749.html#section-1.3.1 + +B + + Net::OAuth2::AccessToken object + +=cut + +sub get_access_token { + my $self = shift; + my ($code) = @_; + + chomp($code); + + $self->{client}{access_token_session} = $self->{client}{oauth_client}->get_access_token($code); + + return $self->{client}{access_token_session}; +} + +=item get_authorization_url() + + Get Authorization Url and request token + +B + + A string for authorization in the browser + +=cut + +sub get_authorization_url { + my $self = shift; + + return $self->{client}{request_token} = $self->{client}{oauth_client}->authorize_response->as_string; +} + +=item has_access_token() + + Check if access token has been already received + +B + + Boolean + +=cut + +sub has_access_token { + my $self = shift; + + return defined $self->{client}{access_token} || + (!($self->{config}{access_token} eq "") && !($self->{config}{refresh_token} eq "")); +} + +=item set_access_token_session() + + Sets the AccessToken session based on the provided config + +B + + Net::OAuth2::AccessToken object + +=cut + +sub set_access_token_session() { + my $self = shift; + + $self->{client}{access_token_session} = Net::OAuth2::AccessToken->new( + profile => $self->{client}->get_oauth_client, + auto_refresh => 0, + ( + access_token => $self->{config}{access_token}, + refresh_token => $self->{config}{refresh_token}, + token_type => TOKEN_TYPE_BEARER, + expires_in => $self->{config}{expires_in}, + expires_at => $self->{config}{expires_at} + ) + ); + + # expire? then refresh + if ($self->{config}{expires_at} < time()) { + $self->{client}{access_token_session}->refresh(); + } +} + +=item client() + + Get client object + +B + + Object + +=cut + +sub client { + my $self = shift; + return $self->{client}; +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2018 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Client.pm b/lib/Net/Upwork/API/Client.pm new file mode 100644 index 0000000..2566efb --- /dev/null +++ b/lib/Net/Upwork/API/Client.pm @@ -0,0 +1,290 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Client; + +use strict; +use warnings; + +use Net::OAuth2::Profile::WebServer; +use IO::Socket::SSL qw( SSL_VERIFY_NONE ); + +use constant BASE_HOST => "https://www.upwork.com"; +use constant DEFAULT_EPOINT => "api"; + +use constant DATA_FORMAT => "json"; +use constant OVERLOAD_VAR => "http_method"; + +use constant URI_AUTH => "/ab/account-security/oauth2/authorize"; +use constant URI_ATOKEN => "/api/v3/oauth2/token"; + +use constant ENTRY_POINT_API => "api"; +use constant ENTRY_POINT_GDS => "gds"; + +=pod + +=head1 NAME + +Client + +=head1 FUNCTIONS + +=over 4 + +=item new($config) + +Create a new Client + +B + +$config + + Config object + +=cut + +sub new { + my $class = shift; + my $config = shift; + my %opts = @_; + $opts{config} = $config; + my $self = bless \%opts, $class; + + $self->get_oauth_client(); + + return $self; +} + +=item get_oauth_client + + Initialize OAuth client + +=cut + +sub get_oauth_client { + my $self = shift; + + $self->{oauth_client} = Net::OAuth2::Profile::WebServer->new( + client_id => $self->{config}{client_id}, + client_secret => $self->{config}{client_secret}, + access_token => $self->{config}{access_token}, + refresh_token => $self->{config}{refresh_token}, + expires_in => $self->{config}{expires_in}, + expires_at => $self->{config}{expires_at}, + site => BASE_HOST, + authorize_path => URI_AUTH, + access_token_path => URI_ATOKEN, + refresh_token_path => URI_ATOKEN, + redirect_uri => $self->{config}{redirect_uri} + ); +} + +=item get + + GET request to protected resource + +B + +$uri + + Resource URL + +$params + + Hash of parameters + +B + + String + +=cut + +sub get { + my $self = shift; + my $uri = shift; + my %params = @_; + + return $self->send_request($uri, "GET", \%params); +} + +=item post + + POST request to protected resource + +B + +$uri + + Resource URL + +$params + + Hash of parameters + +B + + String + +=cut + +sub post { + my $self = shift; + my $uri = shift; + my %params = @_; + + return $self->send_request($uri, "POST", \%params); +} + +=item put + + PUT request to protected resource + +B + +$uri + + Resource URL + +$params + + Hash of parameters + +B + + String + +=cut + +sub put { + my $self = shift; + my $uri = shift; + my %params = @_; + + $params{&OVERLOAD_VAR} = 'put'; + + return $self->send_request($uri, "POST", \%params); +} + +=item delete + + DELETE request to protected resource + +B + +$uri + + Resource URL + +$params + + Hash of parameters + +B + + String + +=cut + +sub delete { + my $self = shift; + my $uri = shift; + my %params = @_; + + $params{&OVERLOAD_VAR} = 'delete'; + + return $self->send_request($uri, "POST", \%params); +} + +=item send_request + + Send a signed OAuth request to a specific protected resource + +B + +$uri + + Resource URI + +$method + + Request method + +$params + + API parameters + +B + + String, a response content + +=cut + +sub send_request { + my ($self, $uri, $method, $params) = @_; + + my $_method = lc $method; + my $response = $self->{access_token_session}->$_method($self->{oauth_client}->site_url(format_uri($uri, $self->{epoint}), %$params)); + + return $response->decoded_content; +} + +=item format_uri + + Create a path to a specific resource + +B + +$uri + + URI to the protected resource + +$epoint + + Specific epoint + +B + + String + +=cut + +sub format_uri { + my ($uri, $epoint) = @_; + $epoint ||= DEFAULT_EPOINT; + + return $epoint . $uri . (($epoint eq DEFAULT_EPOINT) ? "." . DATA_FORMAT : ""); +} + +=item version + + Get version of native OAuth client + +=cut + +sub version { + return $Net::OAuth::VERSION; +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2018 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Config.pm b/lib/Net/Upwork/API/Config.pm new file mode 100644 index 0000000..fd6d942 --- /dev/null +++ b/lib/Net/Upwork/API/Config.pm @@ -0,0 +1,77 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Config; + +use strict; +use warnings; + +=pod + +=head1 NAME + +Config + +=head1 FUNCTIONS + +=over 4 + +=item new(%params) + +Create a new Config + +B + +$params + + List of configuration options + +=cut + +sub new { + my $class = shift; + my %opts = @_; + $opts{client_id} ||= ""; + $opts{client_secret} ||= ""; + $opts{access_token} ||= ""; + $opts{refresh_token} ||= ""; + $opts{expires_in} ||= ""; + $opts{expires_at} ||= ""; + $opts{redirect_uri} ||= ""; + $opts{site} ||= "https://www.upwork.com"; + $opts{authorize_path} ||= "/ab/account-security/oauth2/authorize"; + $opts{access_token_path} ||= "/api/v3/oauth2/token"; + $opts{refresh_token_path} ||= "/api/v3/oauth2/token"; + $opts{callback} ||= ""; + $opts{debug} ||= 0; + unless ($opts{client_id} && $opts{client_secret}) { + die "You must specify a consumer key (client_id) and secret (client_secret) in the config\n"; + } + my $self = bless \%opts, $class; + + return $self; +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2018 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Activities/Engagement.pm b/lib/Net/Upwork/API/Routers/Activities/Engagement.pm new file mode 100644 index 0000000..95597b5 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Activities/Engagement.pm @@ -0,0 +1,150 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Activities::Engagement; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_specific + + List activities for specific engagement + +B + +$engagement_ref + + Engagement reference + +B + + JSON response as a string + +=cut + +sub get_specific { + my $self = shift; + my $engagement_ref = shift; + + return $self->client()->get("/tasks/v2/tasks/contracts/" . $engagement_ref); +} + +=item assign + + Assign engagements to the list of activities + +B + +$company + + Company ID + +$team + + Team ID + +$engagement + + Engagement + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub assign { + my $self = shift; + my $company = shift; + my $team = shift; + my $engagement = shift; + my %params = @_; + + return $self->client()->put("/otask/v1/tasks/companies/" . $company . "/" . $team . "/engagements/" . $engagement, %params); +} + +=item assign_to_engagement + + Assign to specific engagement the list of activities + +B + +$engagement_ref + + Engagement + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub assign_to_engagement { + my $self = shift; + my $engagement_ref = shift; + my %params = @_; + + return $self->client()->put("/tasks/v2/tasks/contracts/" . $engagement_ref, %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Activities/Team.pm b/lib/Net/Upwork/API/Routers/Activities/Team.pm new file mode 100644 index 0000000..f5e31ba --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Activities/Team.pm @@ -0,0 +1,323 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Activities::Team; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_list + + List all oTask/Activity records within a team + +B + +$company + + Company ID + +$team + + Team ID + +B + + JSON response as a string + +=cut + +sub get_list { + my $self = shift; + my $company = shift; + my $team = shift; + + return get_by_type($self, $company, $team); +} + +=item get_specific_list + + List all oTask/Activity records within a Company by specified code(s) + +B + +$company + + Company ID + +$team + + Team ID + +$code + + Code(s) + +B + + JSON response as a string + +=cut + +sub get_specific_list { + my $self = shift; + my $company = shift; + my $team = shift; + my $code = shift; + + return get_by_type($self, $company, $team, $code); +} + +=item add_activity + + Create an oTask/Activity record within a team + +B + +$company + + Company ID + +$team + + Team ID + +$params + + Hash of params + +B + + JSON response as a string + +=cut + +sub add_activity { + my $self = shift; + my $company = shift; + my $team = shift; + my %params = @_; + + return $self->client()->post("/otask/v1/tasks/companies/" . $company . "/teams/" . $team . "/tasks", %params); +} + +=item update_activities + + Update specific oTask/Activity record within a team + +B + +$company + + Company ID + +$team + + Team ID + +$code + + Code + +$params + + Hash of params + +B + + JSON response as a string + +=cut + +sub update_activities { + my $self = shift; + my $company = shift; + my $team = shift; + my $code = shift; + my %params = @_; + + return $self->client()->put("/otask/v1/tasks/companies/" . $company . "/teams/" . $team . "/tasks/" . $code, %params); +} + +=item archive_activities + + Archive specific oTask/Activity record within a team + +B + +$company + + Company ID + +$team + + Team ID + +$code + + Code + +B + + JSON response as a string + +=cut + +sub archive_activities { + my $self = shift; + my $company = shift; + my $team = shift; + my $code = shift; + + return $self->client()->put("/otask/v1/tasks/companies/" . $company . "/teams/" . $team . "/archive/" . $code); +} + +=item unarchive_activities + + Unarchive specific oTask/Activity record within a team + +B + +$company + + Company ID + +$team + + Team ID + +$code + + Code + +B + + JSON response as a string + +=cut + +sub unarchive_activities { + my $self = shift; + my $company = shift; + my $team = shift; + my $code = shift; + + return $self->client()->put("/otask/v1/tasks/companies/" . $company . "/teams/" . $team . "/unarchive/" . $code); +} + +=item update_batch + + Update a group of oTask/Activity records within a company + +B + +$company + + Company ID + +$params + + Hash of params + +B + + JSON response as a string + +=cut + +sub update_batch { + my $self = shift; + my $company = shift; + my %params = @_; + + return $self->client()->put("/otask/v1/tasks/companies/" . $company . "/tasks/batch", %params); +} + +=item get_by_type + + Get by type + +B + +$company + + Company ID + +$team + + Team ID + +$code + + Optional, code. + +B + + String + +=cut + +sub get_by_type { + my ($self, $company, $team, $code) = @_; + $code ||= ""; + + my $url = ""; + unless ($code eq "") { + $url .= "/" . $code; + } + + return $self->client()->get("/otask/v1/tasks/companies/" . $company . "/teams/" . $team . "/tasks" . $url); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Auth.pm b/lib/Net/Upwork/API/Routers/Auth.pm new file mode 100644 index 0000000..9ab73b8 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Auth.pm @@ -0,0 +1,78 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Auth; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_user_info + + Get user info + +B + + JSON response as a string + +=cut + +sub get_user_info { + my $self = shift; + my %params = @_; + + return $self->client()->get("/auth/v1/info", %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Freelancers/Profile.pm b/lib/Net/Upwork/API/Routers/Freelancers/Profile.pm new file mode 100644 index 0000000..3d36c2f --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Freelancers/Profile.pm @@ -0,0 +1,107 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Freelancers::Profile; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_specific + + Get specific profile + +B + +$key + + Profile key + +B + + JSON response as a string + +=cut + +sub get_specific { + my $self = shift; + my $key = shift; + + return $self->client()->get("/profiles/v1/providers/" . $key); +} + +=item get_specific_brief + + Get brief info on specific profile + +B + +$key + + Profile key + +B + + JSON response as a string + +=cut + +sub get_specific_brief { + my $self = shift; + my $key = shift; + + return $self->client()->get("/profiles/v1/providers/" . $key . "/brief"); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Freelancers/Search.pm b/lib/Net/Upwork/API/Routers/Freelancers/Search.pm new file mode 100644 index 0000000..d33c2ab --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Freelancers/Search.pm @@ -0,0 +1,84 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Freelancers::Search; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item find + + Search profiles + +B + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub find { + my $self = shift; + my %params = @_; + + return $self->client()->get("/profiles/v2/search/providers", %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Hr/Clients/Applications.pm b/lib/Net/Upwork/API/Routers/Hr/Clients/Applications.pm new file mode 100644 index 0000000..418a32e --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Hr/Clients/Applications.pm @@ -0,0 +1,112 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Hr::Clients::Applications; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_list + + Get list of applications + +B + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub get_list { + my $self = shift; + my %params = @_; + + return $self->client()->get("/hr/v4/clients/applications", %params); +} + +=item get_specific + + Get specific application + +B + +$reference + + Application reference + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub get_specific { + my $self = shift; + my $reference = shift; + my %params = @_; + + return $self->client()->get("/hr/v4/clients/applications/" . $reference, %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Hr/Clients/Offers.pm b/lib/Net/Upwork/API/Routers/Hr/Clients/Offers.pm new file mode 100644 index 0000000..27ca9bb --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Hr/Clients/Offers.pm @@ -0,0 +1,135 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Hr::Clients::Offers; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_list + + Get list of offers + +B + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub get_list { + my $self = shift; + my %params = @_; + + return $self->client()->get("/offers/v1/clients/offers", %params); +} + +=item get_specific + + Get specific offer + +B + +$reference + + Offer reference + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub get_specific { + my $self = shift; + my $reference = shift; + my %params = @_; + + return $self->client()->get("/offers/v1/clients/offers/" . $reference, %params); +} + +=item make_offer + + Make an Offer + +B + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub make_offer { + my $self = shift; + my %params = @_; + + return $self->client()->post("/offers/v1/clients/offers", %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Hr/Contracts.pm b/lib/Net/Upwork/API/Routers/Hr/Contracts.pm new file mode 100644 index 0000000..bf55d35 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Hr/Contracts.pm @@ -0,0 +1,145 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Hr::Contracts; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item suspend_contract + + Suspend Contract + +B + +$reference + + Contract reference + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub suspend_contract { + my $self = shift; + my $reference = shift; + my %params = @_; + + return $self->client()->put("/hr/v2/contracts/" . $reference . "/suspend", %params); +} + +=item restart_contract + + Restart Contract + +B + +$reference + + Contract reference + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub restart_contract { + my $self = shift; + my $reference = shift; + my %params = @_; + + return $self->client()->put("/hr/v2/contracts/" . $reference . "/restart", %params); +} + +=item end_contract + + End Contract + +B + +$reference + + Contract reference + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub end_contract { + my $self = shift; + my $reference = shift; + my %params = @_; + + return $self->client()->delete("/hr/v2/contracts/" . $reference, %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Hr/Engagements.pm b/lib/Net/Upwork/API/Routers/Hr/Engagements.pm new file mode 100644 index 0000000..3c1b959 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Hr/Engagements.pm @@ -0,0 +1,107 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Hr::Engagements; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_list + + Get list of engagements + +B + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub get_list { + my $self = shift; + my %params = @_; + + return $self->client()->get("/hr/v2/engagements", %params); +} + +=item get_specific + + Get specific engagement + +B + +$reference + + Engagement reference + +B + + JSON response as a string + +=cut + +sub get_specific { + my $self = shift; + my $reference = shift; + + return $self->client()->get("/hr/v2/engagements/" . $reference); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Hr/Freelancers/Applications.pm b/lib/Net/Upwork/API/Routers/Hr/Freelancers/Applications.pm new file mode 100644 index 0000000..53f8834 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Hr/Freelancers/Applications.pm @@ -0,0 +1,112 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Hr::Freelancers::Applications; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_list + + Get list of applications + +B + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub get_list { + my $self = shift; + my %params = @_; + + return $self->client()->get("/hr/v4/contractors/applications", %params); +} + +=item get_specific + + Get specific application + +B + +$reference + + Application reference + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub get_specific { + my $self = shift; + my $reference = shift; + my %params = @_; + + return $self->client()->get("/hr/v4/contractors/applications/" . $reference, %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Hr/Freelancers/Offers.pm b/lib/Net/Upwork/API/Routers/Hr/Freelancers/Offers.pm new file mode 100644 index 0000000..118e946 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Hr/Freelancers/Offers.pm @@ -0,0 +1,140 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Hr::Freelancers::Offers; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_list + + Get list of offers + +B + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub get_list { + my $self = shift; + my %params = @_; + + return $self->client()->get("/offers/v1/contractors/offers", %params); +} + +=item get_specific + + Get specific offer + +B + +$reference + + Offer reference + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub get_specific { + my $self = shift; + my $reference = shift; + my %params = @_; + + return $self->client()->get("/offers/v1/contractors/offers/" . $reference, %params); +} + +=item actions + + Apply specific action + +B + +$reference + + Offer reference + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub actions { + my $self = shift; + my $reference = shift; + my %params = @_; + + return $self->client()->post("/offers/v1/clients/actions/" . $reference, %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Hr/Interviews.pm b/lib/Net/Upwork/API/Routers/Hr/Interviews.pm new file mode 100644 index 0000000..000002e --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Hr/Interviews.pm @@ -0,0 +1,89 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Hr::Interviews; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item invite + + Invite to Interview + +B + +$job_key + + Job key + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub invite { + my $self = shift; + my $job_key = shift; + my %params = @_; + + return $self->client()->post("/hr/v1/jobs/" . $job_key . "/candidates", %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Hr/Jobs.pm b/lib/Net/Upwork/API/Routers/Hr/Jobs.pm new file mode 100644 index 0000000..92310ae --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Hr/Jobs.pm @@ -0,0 +1,186 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Hr::Jobs; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_list + + Get list of jobs + +B + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub get_list { + my $self = shift; + my %params = @_; + + return $self->client()->get("/hr/v2jobs", %params); +} + +=item get_specific + + Get specific job + +B + +$key + + Job key + +B + + JSON response as a string + +=cut + +sub get_specific { + my $self = shift; + my $key = shift; + + return $self->client()->get("/hr/v2/jobs/" . $key); +} + +=item post_job + + Post a new job + +B + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub post_job { + my $self = shift; + my %params = @_; + + return $self->client()->post("/hr/v2jobs", %params); +} + +=item edit_job + + Edit existent job + +B + +$key + + Job key + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub edit_job { + my $self = shift; + my $key = shift; + my %params = @_; + + return $self->client()->put("/hr/v2jobs/" . $key, %params); +} + +=item delete_job + + Delete existent job + +B + +$key + + Job key + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub delete_job { + my $self = shift; + my $key = shift; + my %params = @_; + + return $self->client()->delete("/hr/v2jobs/" . $key, %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Hr/Milestones.pm b/lib/Net/Upwork/API/Routers/Hr/Milestones.pm new file mode 100644 index 0000000..c4261f8 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Hr/Milestones.pm @@ -0,0 +1,237 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Hr::Milestones; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_active_milestone + + Get active Milestone for specific Contract + +B + +$contract_id + + Contract ID + +B + + JSON response as a string + +=cut + +sub get_active_milestone { + my $self = shift; + my $contract_id = shift; + + return $self->client()->get("/hr/v3/fp/milestones/statuses/active/contracts/" . $contract_id); +} + +=item get_submissions + + Get active Milestone for specific Contract + +B + +$milestone_id + + Milestone ID + +B + + JSON response as a string + +=cut + +sub get_submissions { + my $self = shift; + my $milestone_id = shift; + + return $self->client()->get("/hr/v3/fp/milestones/" . $milestone_id . "/submissions"); +} + +=item create + + Create a new Milestone + +B + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub create { + my $self = shift; + my %params = @_; + + return $self->client()->post("/hr/v3/fp/milestones", %params); +} + +=item edit + + Edit an existing Milestone + +B + +$milestone_id + + Milestone ID + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub edit { + my $self = shift; + my $milestone_id = shift; + my %params = @_; + + return $self->client()->put("/hr/v3/fp/milestones/" . $milestone_id, %params); +} + +=item activate + + Activate an existing Milestone + +B + +$milestone_id + + Milestone ID + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub activate { + my $self = shift; + my $milestone_id = shift; + my %params = @_; + + return $self->client()->put("/hr/v3/fp/milestones/" . $milestone_id . "/activate", %params); +} + +=item approve + + Approve an existing Milestone + +B + +$milestone_id + + Milestone ID + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub approve { + my $self = shift; + my $milestone_id = shift; + my %params = @_; + + return $self->client()->put("/hr/v3/fp/milestones/" . $milestone_id . "/approve", %params); +} + +=item delete + + Delete existent milestone + +B + +$milestone_id + + Milestone ID + +B + + JSON response as a string + +=cut + +sub delete { + my $self = shift; + my $milestone_id = shift; + + return $self->client()->delete("/hr/v3/fp/milestones/" . $milestone_id); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Hr/Roles.pm b/lib/Net/Upwork/API/Routers/Hr/Roles.pm new file mode 100644 index 0000000..87d15f7 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Hr/Roles.pm @@ -0,0 +1,100 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Hr::Roles; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_all + + Get user roles + +B + + JSON response as a string + +=cut + +sub get_all { + my $self = shift; + + return $self->client()->get("/hr/v2/userroles"); +} + +=item get_by_specific_user + + Get by specific user + +B + +$user_ref + + User reference + +B + + JSON response as a string + +=cut + +sub get_by_specific_user { + my $self = shift; + my $user_ref = shift; + + return $self->client()->get("/hr/v2/userroles/" . $user_ref); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Hr/Submissions.pm b/lib/Net/Upwork/API/Routers/Hr/Submissions.pm new file mode 100644 index 0000000..fc72680 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Hr/Submissions.pm @@ -0,0 +1,140 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Hr::Submissions; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item request_approval + + Freelancer submits work for the client to approve + +B + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub request_approval { + my $self = shift; + my %params = @_; + + return $self->client()->post("/hr/v3/fp/submissions", %params); +} + +=item approve + + Approve an existing Submission + +B + +$submission_id + + Submission ID + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub approve { + my $self = shift; + my $submission_id = shift; + my %params = @_; + + return $self->client()->put("/hr/v3/fp/submissions/" . $submission_id . "/approve", %params); +} + +=item reject + + Reject an existing Submission + +B + +$submission_id + + Submission ID + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub reject { + my $self = shift; + my $submission_id = shift; + my %params = @_; + + return $self->client()->put("/hr/v3/fp/submissions/" . $submission_id . "/reject", %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Jobs/Profile.pm b/lib/Net/Upwork/API/Routers/Jobs/Profile.pm new file mode 100644 index 0000000..76f015a --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Jobs/Profile.pm @@ -0,0 +1,84 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Jobs::Profile; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_specific + + Get specific profile + +B + +$key + + Profile key + +B + + JSON response as a string + +=cut + +sub get_specific { + my $self = shift; + my $key = shift; + + return $self->client()->get("/profiles/v1/jobs/" . $key); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Jobs/Search.pm b/lib/Net/Upwork/API/Routers/Jobs/Search.pm new file mode 100644 index 0000000..522f97b --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Jobs/Search.pm @@ -0,0 +1,84 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Jobs::Search; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item find + + Search profiles + +B + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub find { + my $self = shift; + my %params = @_; + + return $self->client()->get("/profiles/v2/search/jobs", %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Messages.pm b/lib/Net/Upwork/API/Routers/Messages.pm new file mode 100644 index 0000000..20b58f0 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Messages.pm @@ -0,0 +1,231 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2016(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Messages; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_rooms + + Retrive rooms information + +B + + JSON response as a string + +=cut + +sub get_rooms { + my $self = shift; + my $company = shift; + my %params = @_; + + return $self->client()->get("/messages/v3/" . $company . "/rooms", %params); +} + +=item get_room_details + + Get a specific room information + +B + + JSON response as a string + +=cut + +sub get_room_details { + my $self = shift; + my $company = shift; + my $room_id = shift; + my %params = @_; + + return $self->client()->get("/messages/v3/" . $company . "/rooms/" . $room_id, %params); +} + +=item get_room_by_offer + + Get a specific room by offer ID + +B + + JSON response as a string + +=cut + +sub get_room_by_offer { + my $self = shift; + my $company = shift; + my $offer_id = shift; + my %params = @_; + + return $self->client()->get("/messages/v3/" . $company . "/rooms/offers/" + $offer_id, %params); +} + +=item get_room_by_application + + Get a specific room by application ID + +B + + JSON response as a string + +=cut + +sub get_room_by_application { + my $self = shift; + my $company = shift; + my $application_id = shift; + my %params = @_; + + return $self->client()->get("/messages/v3/" . $company . "/rooms/applications/" + $application_id, %params); +} + +=item get_room_by_contract + + Get a specific room by contract ID + +B + + JSON response as a string + +=cut + +sub get_room_by_contract { + my $self = shift; + my $company = shift; + my $contract_id = shift; + my %params = @_; + + return $self->client()->get("/messages/v3/" . $company . "/rooms/contracts/" + $contract_id, %params); +} + +=item create_room + + Create a new room + +B + + JSON response as a string + +=cut + +sub create_room { + my $self = shift; + my $company = shift; + my %params = @_; + + return $self->client()->post("/messages/v3/" . $company . "/rooms", %params); +} + +=item send_message_to_room + + Send a message to a room + +B + + JSON response as a string + +=cut + +sub send_message_to_room { + my $self = shift; + my $company = shift; + my $room_id = shift; + my %params = @_; + + return $self->client()->post("/messages/v3/" . $company . "/rooms/" . $room_id . '/stories', %params); +} + +=item update_room_settings + + Update a room settings + +B + + JSON response as a string + +=cut + +sub update_room_settings { + my $self = shift; + my $company = shift; + my $room_id = shift; + my $username = shift; + my %params = @_; + + return $self->client()->put("/messages/v3/" . $company . "/rooms/" . $room_id . "/users/" . $username, %params); +} + +=item update_room_metadata + + Update the metadata of a room + +B + + JSON response as a string + +=cut + +sub update_room_metadata { + my $self = shift; + my $company = shift; + my $room_id = shift; + my %params = @_; + + return $self->client()->put("/messages/v3/" . $company . "/rooms/" . $room_id, %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2016 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Metadata.pm b/lib/Net/Upwork/API/Routers/Metadata.pm new file mode 100644 index 0000000..ba68871 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Metadata.pm @@ -0,0 +1,148 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Metadata; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_categories_v2 + + Get categories (V2) + +B + + JSON response as a string + +=cut + +sub get_categories_v2 { + my $self = shift; + + return $self->client()->get("/profiles/v2/metadata/categories"); +} + +=item get_skills + + Get skills + +B + + JSON response as a string + +=cut + +sub get_skills { + my $self = shift; + + return $self->client()->get("/profiles/v1/metadata/skills"); +} + +=item get_regions + + Get regions + +B + + JSON response as a string + +=cut + +sub get_regions { + my $self = shift; + + return $self->client()->get("/profiles/v1/metadata/regions"); +} + +=item get_tests + + Get tests + +B + + JSON response as a string + +=cut + +sub get_tests { + my $self = shift; + + return $self->client()->get("/profiles/v1/metadata/tests"); +} + +=item get_reasons + + Get reasons + +B + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub get_reasons { + my $self = shift; + my %params = @_; + + return $self->client()->get("/profiles/v1/metadata/reasons", %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Organization/Companies.pm b/lib/Net/Upwork/API/Routers/Organization/Companies.pm new file mode 100644 index 0000000..04d16ab --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Organization/Companies.pm @@ -0,0 +1,146 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Organization::Companies; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_list + + Get Companies Info + +B + + JSON response as a string + +=cut + +sub get_list { + my $self = shift; + + return $self->client()->get("/hr/v2/companies"); +} + +=item get_specific + + Get Specific Company + +B + +$company_ref + + Company reference + +B + + JSON response as a string + +=cut + +sub get_specific { + my $self = shift; + my $company_ref = shift; + + return $self->client()->get("/hr/v2/companies/" . $company_ref); +} + +=item get_teams + + Get Teams in Company + +B + +$company_ref + + Company reference + +B + + JSON response as a string + +=cut + +sub get_teams { + my $self = shift; + my $company_ref = shift; + + return $self->client()->get("/hr/v2/companies/" . $company_ref . "/teams"); +} + +=item get_users + + Get Users in Company + +B + +$company_ref + + Company reference + +B + + JSON response as a string + +=cut + +sub get_users { + my $self = shift; + my $company_ref = shift; + + return $self->client()->get("/hr/v2/companies/" . $company_ref . "/users"); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Organization/Teams.pm b/lib/Net/Upwork/API/Routers/Organization/Teams.pm new file mode 100644 index 0000000..ce33a54 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Organization/Teams.pm @@ -0,0 +1,100 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Organization::Teams; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_list + + Get Teams Info + +B + + JSON response as a string + +=cut + +sub get_list { + my $self = shift; + + return $self->client()->get("/hr/v2/teams"); +} + +=item get_users_in_team + + Get Users in Team + +B + +$team_ref + + Team reference + +B + + JSON response as a string + +=cut + +sub get_users_in_team { + my $self = shift; + my $team_ref = shift; + + return $self->client()->get("/hr/v2/teams/" . $team_ref . "/users"); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Organization/Users.pm b/lib/Net/Upwork/API/Routers/Organization/Users.pm new file mode 100644 index 0000000..7e893e2 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Organization/Users.pm @@ -0,0 +1,100 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Organization::Users; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_my_info + + Get Auth User Info + +B + + JSON response as a string + +=cut + +sub get_my_info { + my $self = shift; + + return $self->client()->get("/hr/v2/users/me"); +} + +=item get_specific + + Get Specific User Indo + +B + +$user_ref + + User reference + +B + + JSON response as a string + +=cut + +sub get_specific { + my $self = shift; + my $user_ref = shift; + + return $self->client()->get("/hr/v2/users/" . $user_ref); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Payments.pm b/lib/Net/Upwork/API/Routers/Payments.pm new file mode 100644 index 0000000..5b26fc6 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Payments.pm @@ -0,0 +1,89 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Payments; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item submit_bonus + + Submit bonus + +B + +$team_reference + + Team reference + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub submit_bonus { + my $self = shift; + my $team_reference = shift; + my %params = @_; + + return $self->client()->post("/hr/v2/teams/" . $team_reference . "/adjustments", %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Reports/Finance/Accounts.pm b/lib/Net/Upwork/API/Routers/Reports/Finance/Accounts.pm new file mode 100644 index 0000000..ad96171 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Reports/Finance/Accounts.pm @@ -0,0 +1,109 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Reports::Finance::Accounts; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_GDS; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_owned + + Generate Financial Reports for an owned Account + +B + +$freelancer_ref + + Freelancer reference + +B + + JSON response as a string + +=cut + +sub get_owned { + my $self = shift; + my $freelancer_ref = shift; + my %params = @_; + + return $self->client()->get("/finreports/v2/financial_account_owner/" . $freelancer_ref, %params); +} + +=item get_specific + + Generate Financial Reports for a Specific Account + +B + +$entity_ref + + Entity reference + +B + + JSON response as a string + +=cut + +sub get_specific { + my $self = shift; + my $entity_ref = shift; + my %params = @_; + + return $self->client()->get("/finreports/v2/financial_accounts/" . $entity_ref, %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Reports/Finance/Billings.pm b/lib/Net/Upwork/API/Routers/Reports/Finance/Billings.pm new file mode 100644 index 0000000..b660f6b --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Reports/Finance/Billings.pm @@ -0,0 +1,181 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Reports::Finance::Billings; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_GDS; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_by_freelancer + + Generate Billing Reports for a Specific Freelancer + +B + +$freelancer_ref + + Freelancer reference + +B + + JSON response as a string + +=cut + +sub get_by_freelancer { + my $self = shift; + my $freelancer_ref = shift; + my %params = @_; + + return $self->client()->get("/finreports/v2/providers/" . $freelancer_ref . "/billings", %params); +} + +=item get_by_freelancers_team + + Generate Billing Reports for a Specific Freelancer's Team + +B + +$freelancer_team_ref + + Freelancer's team reference + +B + + JSON response as a string + +=cut + +sub get_by_freelancers_team { + my $self = shift; + my $freelancer_team_ref = shift; + my %params = @_; + + return $self->client()->get("/finreports/v2/provider_teams/" . $freelancer_team_ref . "/billings", %params); +} + +=item get_by_freelancers_company + + Generate Billing Reports for a Specific Freelancer's Company + +B + +$freelancer_company_ref + + Freelancer's company reference + +B + + JSON response as a string + +=cut + +sub get_by_freelancers_company { + my $self = shift; + my $freelancer_company_ref = shift; + my %params = @_; + + return $self->client()->get("/finreports/v2/provider_companies/" . $freelancer_company_ref . "/billings", %params); +} + +=item get_by_buyers_team + + Generate Billing Reports for a Specific Buyer's Team + +B + +$buyer_team_ref + + Buyer's team reference + +B + + JSON response as a string + +=cut + +sub get_by_buyers_team { + my $self = shift; + my $buyer_team_ref = shift; + my %params = @_; + + return $self->client()->get("/finreports/v2/buyer_teams/" . $buyer_team_ref . "/billings", %params); +} + +=item get_by_buyers_company + + Generate Billing Reports for a Specific Buyer's Company + +B + +$buyer_company_ref + + Buyer's company reference + +B + + JSON response as a string + +=cut + +sub get_by_buyers_company { + my $self = shift; + my $buyer_company_ref = shift; + my %params = @_; + + return $self->client()->get("/finreports/v2/buyer_companies/" . $buyer_company_ref . "/billings", %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Reports/Finance/Earnings.pm b/lib/Net/Upwork/API/Routers/Reports/Finance/Earnings.pm new file mode 100644 index 0000000..ba78013 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Reports/Finance/Earnings.pm @@ -0,0 +1,181 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Reports::Finance::Earnings; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_GDS; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_by_freelancer + + Generate Earning Reports for a Specific Freelancer + +B + +$freelancer_ref + + Freelancer reference + +B + + JSON response as a string + +=cut + +sub get_by_freelancer { + my $self = shift; + my $freelancer_ref = shift; + my %params = @_; + + return $self->client()->get("/finreports/v2/providers/" . $freelancer_ref . "/earnings", %params); +} + +=item get_by_freelancers_team + + Generate Earning Reports for a Specific Freelancer's Team + +B + +$freelancer_team_ref + + Freelancer's team reference + +B + + JSON response as a string + +=cut + +sub get_by_freelancers_team { + my $self = shift; + my $freelancer_team_ref = shift; + my %params = @_; + + return $self->client()->get("/finreports/v2/provider_teams/" . $freelancer_team_ref . "/earnings", %params); +} + +=item get_by_freelancers_company + + Generate Earning Reports for a Specific Freelancer's Company + +B + +$freelancer_company_ref + + Freelancer's company reference + +B + + JSON response as a string + +=cut + +sub get_by_freelancers_company { + my $self = shift; + my $freelancer_company_ref = shift; + my %params = @_; + + return $self->client()->get("/finreports/v2/provider_companies/" . $freelancer_company_ref . "/earnings", %params); +} + +=item get_by_buyers_team + + Generate Earning Reports for a Specific Buyer's Team + +B + +$buyer_team_ref + + Buyer's team reference + +B + + JSON response as a string + +=cut + +sub get_by_buyers_team { + my $self = shift; + my $buyer_team_ref = shift; + my %params = @_; + + return $self->client()->get("/finreports/v2/buyer_teams/" . $buyer_team_ref . "/earnings", %params); +} + +=item get_by_buyers_company + + Generate Earning Reports for a Specific Buyer's Company + +B + +$buyer_company_ref + + Buyer's company reference + +B + + JSON response as a string + +=cut + +sub get_by_buyers_company { + my $self = shift; + my $buyer_company_ref = shift; + my %params = @_; + + return $self->client()->get("/finreports/v2/buyer_companies/" . $buyer_company_ref . "/earnings", %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Reports/Time.pm b/lib/Net/Upwork/API/Routers/Reports/Time.pm new file mode 100644 index 0000000..05191db --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Reports/Time.pm @@ -0,0 +1,273 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Reports::Time; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_GDS; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_by_team_full + + Generate Time Reports for a Specific Team (with financial info) + +B + +$company + + Company + +$team + + Team + +B + + JSON response as a string + +=cut + +sub get_by_team_full { + my $self = shift; + my $company = shift; + my $team = shift; + my %params = @_; + + return $self->get_by_type($company, $team, "", 0, %params); +} + +=item get_by_team_limited + + Generate Time Reports for a Specific Team (hide financial info) + +B + +$company + + Company + +$team + + Team + +B + + JSON response as a string + +=cut + +sub get_by_team_limited { + my $self = shift; + my $company = shift; + my $team = shift; + my %params = @_; + + return $self->get_by_type($company, $team, "", 1, %params); +} + +=item get_by_agency + + Generating Agency Specific Reports + +B + +$company + + Company + +$agency + + Agency + +B + + JSON response as a string + +=cut + +sub get_by_agency { + my $self = shift; + my $company = shift; + my $agency = shift; + my %params = @_; + + return $self->get_by_type($company, "", $agency, 0, %params); +} + +=item get_by_company + + Generating Company Wide Reports + +B + +$company + + Company + +B + + JSON response as a string + +=cut + +sub get_by_company { + my $self = shift; + my $company = shift; + my %params = @_; + + return $self->get_by_type($company, "", "", 0, %params); +} + +=item get_by_freelancer_limited + + Generating Freelancer's Specific Reports (hide financial info) + +B + +$freelancer_id + + Freelancer ID + +B + + JSON response as a string + +=cut + +sub get_by_freelancer_limited { + my $self = shift; + my $freelancer_id = shift; + my %params = @_; + + return $self->client()->get("/timereports/v1/providers/" . $freelancer_id . "/hours", %params); +} + +=item get_by_freelancer_full + + Generating Freelancer's Specific Reports (with financial info) + +B + +$freelancer_id + + Freelancer ID + +B + + JSON response as a string + +=cut + +sub get_by_freelancer_full { + my $self = shift; + my $freelancer_id = shift; + my %params = @_; + + return $self->client()->get("/timereports/v1/providers/" . $freelancer_id, %params); +} + +=item get_by_type + + Get by type + +B + +$company + + Company + +$team + + Team + +$agency + + Agency + +$hide_fin_data + + Hide financial data flag + +$params + + Hash of parameters + +B + + String + +=cut + +sub get_by_type { + my $self = shift; + my $company = shift; + my $team = shift; + my $agency = shift; + my $hide_fin_data = shift; + my %params = @_; + + my $url = ""; + if (length $team) { + $url = "/teams/" . $team; + if ($hide_fin_data) { + $url .= "/hours"; + } elsif (length $agency) { + $url = "/agencies/" . $agency; + } + } + + return $self->client()->get("/timereports/v1/companies/" . $company . $url, %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Snapshot.pm b/lib/Net/Upwork/API/Routers/Snapshot.pm new file mode 100644 index 0000000..2091b3d --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Snapshot.pm @@ -0,0 +1,150 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Snapshot; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_by_contract + + Get snapshot info by specific contract + +B + +$contract + + Contract number + +$ts + + Timestamp + +B + + JSON response as a string + +=cut + +sub get_by_contract { + my $self = shift; + my $contract = shift; + my $ts = shift; + + return $self->client()->get("/team/v2/snapshots/contracts/" . $contract . "/" . $ts); +} + +=item update_by_contract + + Update snapshot info by specific contract + +B + +$contract + + Contract number + +$ts + + Timestamp + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub update_by_contract { + my $self = shift; + my $contract = shift; + my $ts = shift; + my %params = @_; + + return $self->client()->put("/team/v2/snapshots/contracts/" . $contract . "/" . $ts, %params); +} + +=item delete_by_contract + + Delete snapshot info by specific contract + +B + +$contract + + Contract number + +$ts + + Timestamp + +B + + JSON response as a string + +=cut + +sub delete_by_contract { + my $self = shift; + my $contract = shift; + my $ts = shift; + + return $self->client()->delete("/team/v2/snapshots/contracts/" . $contract . "/" . $ts); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Workdays.pm b/lib/Net/Upwork/API/Routers/Workdays.pm new file mode 100644 index 0000000..a388328 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Workdays.pm @@ -0,0 +1,137 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Workdays; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_by_company + + Get Workdays by Company + +B + +$company + + Company ID + +$from_date + + Start date + +$till_date + + End date + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub get_by_company { + my $self = shift; + my $company = shift; + my $from_date = shift; + my $till_date = shift; + my %params = @_; + + return $self->client()->get("/team/v2/workdays/companies/" . $company . "/" . $from_date . "," . $till_date, %params); +} + +=item get_by_contract + + Get Workdays by Contract + +B + +$contract + + Contract ID + +$from_date + + Start date + +$till_date + + End date + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub get_by_contract { + my $self = shift; + my $contract = shift; + my $from_date = shift; + my $till_date = shift; + my %params = @_; + + return $self->client()->get("/team/v2/workdays/contracts/" . $contract . "/" . $from_date . "," . $till_date, %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/lib/Net/Upwork/API/Routers/Workdiary.pm b/lib/Net/Upwork/API/Routers/Workdiary.pm new file mode 100644 index 0000000..ef6f421 --- /dev/null +++ b/lib/Net/Upwork/API/Routers/Workdiary.pm @@ -0,0 +1,94 @@ +# Licensed under the Upwork's API Terms of Use; +# you may not use this file except in compliance with the Terms. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) +# Copyright:: Copyright 2015(c) Upwork.com +# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html + +package Net::Upwork::API::Routers::Workdiary; + +use strict; +use warnings; +use parent "Net::Upwork::API"; + +use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; + +=pod + +=head1 NAME + +Auth + +=head1 FUNCTIONS + +=over 4 + +=item new($api) + +Create a new object for accessing Auth API + +B + +$api + + API object + +=cut + +sub new { + my ($class, $api) = @_; + return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); +} + +=item get_by_contract + + Get Workdiary by Contract + +B + +$contract + + Contract ID + +$date + + Date + +$params + + Hash of parameters + +B + + JSON response as a string + +=cut + +sub get_by_contract { + my $self = shift; + my $contract = shift; + my $date = shift; + my %params = @_; + + return $self->client()->get("/team/v2/workdiaries/contracts/" . $contract . "/" . $date, %params); +} + +=back + +=head1 AUTHOR + +Maksym Novozhylov C<< >> + +=head1 COPYRIGHT + +Copyright E Upwork Global Corp., 2015 + +=cut + +1; diff --git a/t/0-signature.t b/t/0-signature.t new file mode 100644 index 0000000..4807afd --- /dev/null +++ b/t/0-signature.t @@ -0,0 +1,28 @@ +#!/usr/bin/perl + +use strict; +print "1..1\n"; + +if (!$ENV{TEST_SIGNATURE}) { +print "ok 1 # skip Set the environment variable", + " TEST_SIGNATURE to enable this test\n"; +} +elsif (!-s 'SIGNATURE') { +print "ok 1 # skip No signature file found\n"; +} +elsif (!eval { require Module::Signature; 1 }) { +print "ok 1 # skip ", + "Next time around, consider install Module::Signature, ", + "so you can verify the integrity of this distribution.\n"; +} +elsif (!eval { require Socket; Socket::inet_aton('pool.sks-keyservers.net') }) { +print "ok 1 # skip ", + "Cannot connect to the keyserver\n"; +} +else { +(Module::Signature::verify() == Module::Signature::SIGNATURE_OK()) + or print "not "; +print "ok 1 # Valid signature\n"; +} + +__END__ diff --git a/t/00.load.t b/t/00.load.t new file mode 100644 index 0000000..0987aee --- /dev/null +++ b/t/00.load.t @@ -0,0 +1,34 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 29; +use lib qw(lib); + +use_ok('Net::Upwork::API'); +use_ok('Net::Upwork::API::Config'); +use_ok('Net::Upwork::API::Client'); +use_ok('Net::Upwork::API::Routers::Auth'); +use_ok('Net::Upwork::API::Routers::Messages'); +use_ok('Net::Upwork::API::Routers::Snapshot'); +use_ok('Net::Upwork::API::Routers::Metadata'); +use_ok('Net::Upwork::API::Routers::Payments'); +use_ok('Net::Upwork::API::Routers::Workdays'); +use_ok('Net::Upwork::API::Routers::Workdiary'); +use_ok('Net::Upwork::API::Routers::Activities::Engagement'); +use_ok('Net::Upwork::API::Routers::Activities::Team'); +use_ok('Net::Upwork::API::Routers::Freelancers::Profile'); +use_ok('Net::Upwork::API::Routers::Freelancers::Search'); +use_ok('Net::Upwork::API::Routers::Jobs::Profile'); +use_ok('Net::Upwork::API::Routers::Jobs::Search'); +use_ok('Net::Upwork::API::Routers::Organization::Companies'); +use_ok('Net::Upwork::API::Routers::Organization::Teams'); +use_ok('Net::Upwork::API::Routers::Organization::Users'); +use_ok('Net::Upwork::API::Routers::Hr::Contracts'); +use_ok('Net::Upwork::API::Routers::Hr::Engagements'); +use_ok('Net::Upwork::API::Routers::Hr::Interviews'); +use_ok('Net::Upwork::API::Routers::Hr::Jobs'); +use_ok('Net::Upwork::API::Routers::Hr::Milestones'); +use_ok('Net::Upwork::API::Routers::Hr::Submissions'); +use_ok('Net::Upwork::API::Routers::Hr::Clients::Applications'); +use_ok('Net::Upwork::API::Routers::Hr::Clients::Offers'); +use_ok('Net::Upwork::API::Routers::Hr::Freelancers::Applications'); +use_ok('Net::Upwork::API::Routers::Hr::Freelancers::Offers'); diff --git a/t/01.core_packages.t b/t/01.core_packages.t new file mode 100644 index 0000000..7f16074 --- /dev/null +++ b/t/01.core_packages.t @@ -0,0 +1,27 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 16; +use lib qw(lib); +use Net::Upwork::API; +use Net::Upwork::API::Config; +use Net::Upwork::API::Client; + +# API +can_ok('Net::Upwork::API', 'new'); +can_ok('Net::Upwork::API', 'init_router'); +can_ok('Net::Upwork::API', 'get_access_token'); +can_ok('Net::Upwork::API', 'get_authorization_url'); +can_ok('Net::Upwork::API', 'has_access_token'); +can_ok('Net::Upwork::API', 'client'); +# Config +can_ok('Net::Upwork::API::Config', 'new'); +# Client +can_ok('Net::Upwork::API::Client', 'new'); +can_ok('Net::Upwork::API::Client', 'get_oauth_client'); +can_ok('Net::Upwork::API::Client', 'get'); +can_ok('Net::Upwork::API::Client', 'post'); +can_ok('Net::Upwork::API::Client', 'put'); +can_ok('Net::Upwork::API::Client', 'delete'); +can_ok('Net::Upwork::API::Client', 'send_request'); +can_ok('Net::Upwork::API::Client', 'format_uri'); +can_ok('Net::Upwork::API::Client', 'version'); diff --git a/t/02.routers_auth.t b/t/02.routers_auth.t new file mode 100644 index 0000000..35da6a9 --- /dev/null +++ b/t/02.routers_auth.t @@ -0,0 +1,8 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 2; +use lib qw(lib); +use Net::Upwork::API::Routers::Auth; + +can_ok('Net::Upwork::API::Routers::Auth', 'new'); +can_ok('Net::Upwork::API::Routers::Auth', 'get_user_info'); diff --git a/t/03.routers_messages.t b/t/03.routers_messages.t new file mode 100644 index 0000000..ffe3fe8 --- /dev/null +++ b/t/03.routers_messages.t @@ -0,0 +1,16 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 10; +use lib qw(lib); +use Net::Upwork::API::Routers::Messages; + +can_ok('Net::Upwork::API::Routers::Messages', 'new'); +can_ok('Net::Upwork::API::Routers::Messages', 'get_rooms'); +can_ok('Net::Upwork::API::Routers::Messages', 'get_room_details'); +can_ok('Net::Upwork::API::Routers::Messages', 'get_room_by_offer'); +can_ok('Net::Upwork::API::Routers::Messages', 'get_room_by_application'); +can_ok('Net::Upwork::API::Routers::Messages', 'get_room_by_contract'); +can_ok('Net::Upwork::API::Routers::Messages', 'create_room'); +can_ok('Net::Upwork::API::Routers::Messages', 'send_message_to_room'); +can_ok('Net::Upwork::API::Routers::Messages', 'update_room_settings'); +can_ok('Net::Upwork::API::Routers::Messages', 'update_room_metadata'); diff --git a/t/04.routers_snapshot.t b/t/04.routers_snapshot.t new file mode 100644 index 0000000..d743f4c --- /dev/null +++ b/t/04.routers_snapshot.t @@ -0,0 +1,10 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 4; +use lib qw(lib); +use Net::Upwork::API::Routers::Snapshot; + +can_ok('Net::Upwork::API::Routers::Snapshot', 'new'); +can_ok('Net::Upwork::API::Routers::Snapshot', 'get_by_contract'); +can_ok('Net::Upwork::API::Routers::Snapshot', 'update_by_contract'); +can_ok('Net::Upwork::API::Routers::Snapshot', 'delete_by_contract'); diff --git a/t/05.routers_metadata.t b/t/05.routers_metadata.t new file mode 100644 index 0000000..a217df7 --- /dev/null +++ b/t/05.routers_metadata.t @@ -0,0 +1,12 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 6; +use lib qw(lib); +use Net::Upwork::API::Routers::Metadata; + +can_ok('Net::Upwork::API::Routers::Metadata', 'new'); +can_ok('Net::Upwork::API::Routers::Metadata', 'get_categories_v2'); +can_ok('Net::Upwork::API::Routers::Metadata', 'get_skills'); +can_ok('Net::Upwork::API::Routers::Metadata', 'get_regions'); +can_ok('Net::Upwork::API::Routers::Metadata', 'get_tests'); +can_ok('Net::Upwork::API::Routers::Metadata', 'get_reasons'); diff --git a/t/06.routers_payments.t b/t/06.routers_payments.t new file mode 100644 index 0000000..1b0189a --- /dev/null +++ b/t/06.routers_payments.t @@ -0,0 +1,8 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 2; +use lib qw(lib); +use Net::Upwork::API::Routers::Payments; + +can_ok('Net::Upwork::API::Routers::Payments', 'new'); +can_ok('Net::Upwork::API::Routers::Payments', 'submit_bonus'); diff --git a/t/07.routers_workdays.t b/t/07.routers_workdays.t new file mode 100644 index 0000000..cd28647 --- /dev/null +++ b/t/07.routers_workdays.t @@ -0,0 +1,9 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 3; +use lib qw(lib); +use Net::Upwork::API::Routers::Workdays; + +can_ok('Net::Upwork::API::Routers::Workdays', 'new'); +can_ok('Net::Upwork::API::Routers::Workdays', 'get_by_company'); +can_ok('Net::Upwork::API::Routers::Workdays', 'get_by_contract'); diff --git a/t/08.routers_workdiary.t b/t/08.routers_workdiary.t new file mode 100644 index 0000000..a4449a5 --- /dev/null +++ b/t/08.routers_workdiary.t @@ -0,0 +1,8 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 2; +use lib qw(lib); +use Net::Upwork::API::Routers::Workdiary; + +can_ok('Net::Upwork::API::Routers::Workdiary', 'new'); +can_ok('Net::Upwork::API::Routers::Workdiary', 'get_by_contract'); diff --git a/t/09.routers_activities_engagement.t b/t/09.routers_activities_engagement.t new file mode 100644 index 0000000..9de321a --- /dev/null +++ b/t/09.routers_activities_engagement.t @@ -0,0 +1,10 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 4; +use lib qw(lib); +use Net::Upwork::API::Routers::Activities::Engagement; + +can_ok('Net::Upwork::API::Routers::Activities::Engagement', 'new'); +can_ok('Net::Upwork::API::Routers::Activities::Engagement', 'get_specific'); +can_ok('Net::Upwork::API::Routers::Activities::Engagement', 'assign'); +can_ok('Net::Upwork::API::Routers::Activities::Engagement', 'assign_to_engagement'); diff --git a/t/10.routers_activities_team.t b/t/10.routers_activities_team.t new file mode 100644 index 0000000..6e3ed61 --- /dev/null +++ b/t/10.routers_activities_team.t @@ -0,0 +1,16 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 9; +use lib qw(lib); +use Net::Upwork::API::Routers::Activities::Team; + +can_ok('Net::Upwork::API::Routers::Activities::Team', 'new'); +can_ok('Net::Upwork::API::Routers::Activities::Team', 'get_list'); +can_ok('Net::Upwork::API::Routers::Activities::Team', 'get_specific_list'); +can_ok('Net::Upwork::API::Routers::Activities::Team', 'add_activity'); +can_ok('Net::Upwork::API::Routers::Activities::Team', 'update_activities'); +can_ok('Net::Upwork::API::Routers::Activities::Team', 'archive_activities'); +can_ok('Net::Upwork::API::Routers::Activities::Team', 'unarchive_activities'); +can_ok('Net::Upwork::API::Routers::Activities::Team', 'update_batch'); +# local +can_ok('Net::Upwork::API::Routers::Activities::Team', 'get_by_type'); diff --git a/t/11.routers_freelancers_profile.t b/t/11.routers_freelancers_profile.t new file mode 100644 index 0000000..b1ffd6e --- /dev/null +++ b/t/11.routers_freelancers_profile.t @@ -0,0 +1,9 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 3; +use lib qw(lib); +use Net::Upwork::API::Routers::Freelancers::Profile; + +can_ok('Net::Upwork::API::Routers::Freelancers::Profile', 'new'); +can_ok('Net::Upwork::API::Routers::Freelancers::Profile', 'get_specific'); +can_ok('Net::Upwork::API::Routers::Freelancers::Profile', 'get_specific_brief'); diff --git a/t/12.routers_freelancers_search.t b/t/12.routers_freelancers_search.t new file mode 100644 index 0000000..086478a --- /dev/null +++ b/t/12.routers_freelancers_search.t @@ -0,0 +1,8 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 2; +use lib qw(lib); +use Net::Upwork::API::Routers::Freelancers::Search; + +can_ok('Net::Upwork::API::Routers::Freelancers::Search', 'new'); +can_ok('Net::Upwork::API::Routers::Freelancers::Search', 'find'); diff --git a/t/13.routers_jobs_profile.t b/t/13.routers_jobs_profile.t new file mode 100644 index 0000000..82664f7 --- /dev/null +++ b/t/13.routers_jobs_profile.t @@ -0,0 +1,8 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 2; +use lib qw(lib); +use Net::Upwork::API::Routers::Jobs::Profile; + +can_ok('Net::Upwork::API::Routers::Jobs::Profile', 'new'); +can_ok('Net::Upwork::API::Routers::Jobs::Profile', 'get_specific'); diff --git a/t/14.routers_jobs_search.t b/t/14.routers_jobs_search.t new file mode 100644 index 0000000..82c8c7e --- /dev/null +++ b/t/14.routers_jobs_search.t @@ -0,0 +1,8 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 2; +use lib qw(lib); +use Net::Upwork::API::Routers::Jobs::Search; + +can_ok('Net::Upwork::API::Routers::Jobs::Search', 'new'); +can_ok('Net::Upwork::API::Routers::Jobs::Search', 'find'); diff --git a/t/15.routers_organization_companies.t b/t/15.routers_organization_companies.t new file mode 100644 index 0000000..9dd8dce --- /dev/null +++ b/t/15.routers_organization_companies.t @@ -0,0 +1,11 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 5; +use lib qw(lib); +use Net::Upwork::API::Routers::Organization::Companies; + +can_ok('Net::Upwork::API::Routers::Organization::Companies', 'new'); +can_ok('Net::Upwork::API::Routers::Organization::Companies', 'get_list'); +can_ok('Net::Upwork::API::Routers::Organization::Companies', 'get_specific'); +can_ok('Net::Upwork::API::Routers::Organization::Companies', 'get_teams'); +can_ok('Net::Upwork::API::Routers::Organization::Companies', 'get_users'); diff --git a/t/16.routers_organization_teams.t b/t/16.routers_organization_teams.t new file mode 100644 index 0000000..b3b9768 --- /dev/null +++ b/t/16.routers_organization_teams.t @@ -0,0 +1,9 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 3; +use lib qw(lib); +use Net::Upwork::API::Routers::Organization::Teams; + +can_ok('Net::Upwork::API::Routers::Organization::Teams', 'new'); +can_ok('Net::Upwork::API::Routers::Organization::Teams', 'get_list'); +can_ok('Net::Upwork::API::Routers::Organization::Teams', 'get_users_in_team'); diff --git a/t/17.routers_organization_users.t b/t/17.routers_organization_users.t new file mode 100644 index 0000000..dda234a --- /dev/null +++ b/t/17.routers_organization_users.t @@ -0,0 +1,9 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 3; +use lib qw(lib); +use Net::Upwork::API::Routers::Organization::Users; + +can_ok('Net::Upwork::API::Routers::Organization::Users', 'new'); +can_ok('Net::Upwork::API::Routers::Organization::Users', 'get_my_info'); +can_ok('Net::Upwork::API::Routers::Organization::Users', 'get_specific'); diff --git a/t/18.routers_hr_contracts.t b/t/18.routers_hr_contracts.t new file mode 100644 index 0000000..c5fbce0 --- /dev/null +++ b/t/18.routers_hr_contracts.t @@ -0,0 +1,10 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 4; +use lib qw(lib); +use Net::Upwork::API::Routers::Hr::Contracts; + +can_ok('Net::Upwork::API::Routers::Hr::Contracts', 'new'); +can_ok('Net::Upwork::API::Routers::Hr::Contracts', 'suspend_contract'); +can_ok('Net::Upwork::API::Routers::Hr::Contracts', 'restart_contract'); +can_ok('Net::Upwork::API::Routers::Hr::Contracts', 'end_contract'); diff --git a/t/19.routers_hr_engagements.t b/t/19.routers_hr_engagements.t new file mode 100644 index 0000000..0f46944 --- /dev/null +++ b/t/19.routers_hr_engagements.t @@ -0,0 +1,9 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 3; +use lib qw(lib); +use Net::Upwork::API::Routers::Hr::Engagements; + +can_ok('Net::Upwork::API::Routers::Hr::Engagements', 'new'); +can_ok('Net::Upwork::API::Routers::Hr::Engagements', 'get_list'); +can_ok('Net::Upwork::API::Routers::Hr::Engagements', 'get_specific'); diff --git a/t/20.routers_hr_interviews.t b/t/20.routers_hr_interviews.t new file mode 100644 index 0000000..4a80373 --- /dev/null +++ b/t/20.routers_hr_interviews.t @@ -0,0 +1,8 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 2; +use lib qw(lib); +use Net::Upwork::API::Routers::Hr::Interviews; + +can_ok('Net::Upwork::API::Routers::Hr::Interviews', 'new'); +can_ok('Net::Upwork::API::Routers::Hr::Interviews', 'invite'); diff --git a/t/21.routers_hr_jobs.t b/t/21.routers_hr_jobs.t new file mode 100644 index 0000000..667114f --- /dev/null +++ b/t/21.routers_hr_jobs.t @@ -0,0 +1,12 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 6; +use lib qw(lib); +use Net::Upwork::API::Routers::Hr::Jobs; + +can_ok('Net::Upwork::API::Routers::Hr::Jobs', 'new'); +can_ok('Net::Upwork::API::Routers::Hr::Jobs', 'get_list'); +can_ok('Net::Upwork::API::Routers::Hr::Jobs', 'get_specific'); +can_ok('Net::Upwork::API::Routers::Hr::Jobs', 'post_job'); +can_ok('Net::Upwork::API::Routers::Hr::Jobs', 'edit_job'); +can_ok('Net::Upwork::API::Routers::Hr::Jobs', 'delete_job'); diff --git a/t/22.routers_hr_milestones.t b/t/22.routers_hr_milestones.t new file mode 100644 index 0000000..ac65fb0 --- /dev/null +++ b/t/22.routers_hr_milestones.t @@ -0,0 +1,14 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 8; +use lib qw(lib); +use Net::Upwork::API::Routers::Hr::Milestones; + +can_ok('Net::Upwork::API::Routers::Hr::Milestones', 'new'); +can_ok('Net::Upwork::API::Routers::Hr::Milestones', 'get_active_milestone'); +can_ok('Net::Upwork::API::Routers::Hr::Milestones', 'get_submissions'); +can_ok('Net::Upwork::API::Routers::Hr::Milestones', 'create'); +can_ok('Net::Upwork::API::Routers::Hr::Milestones', 'edit'); +can_ok('Net::Upwork::API::Routers::Hr::Milestones', 'activate'); +can_ok('Net::Upwork::API::Routers::Hr::Milestones', 'approve'); +can_ok('Net::Upwork::API::Routers::Hr::Milestones', 'delete'); diff --git a/t/23.routers_hr_submissions.t b/t/23.routers_hr_submissions.t new file mode 100644 index 0000000..6343767 --- /dev/null +++ b/t/23.routers_hr_submissions.t @@ -0,0 +1,10 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 4; +use lib qw(lib); +use Net::Upwork::API::Routers::Hr::Submissions; + +can_ok('Net::Upwork::API::Routers::Hr::Submissions', 'new'); +can_ok('Net::Upwork::API::Routers::Hr::Submissions', 'request_approval'); +can_ok('Net::Upwork::API::Routers::Hr::Submissions', 'approve'); +can_ok('Net::Upwork::API::Routers::Hr::Submissions', 'reject'); diff --git a/t/24.routers_hr_clients_applications.t b/t/24.routers_hr_clients_applications.t new file mode 100644 index 0000000..1832095 --- /dev/null +++ b/t/24.routers_hr_clients_applications.t @@ -0,0 +1,9 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 3; +use lib qw(lib); +use Net::Upwork::API::Routers::Hr::Clients::Applications; + +can_ok('Net::Upwork::API::Routers::Hr::Clients::Applications', 'new'); +can_ok('Net::Upwork::API::Routers::Hr::Clients::Applications', 'get_list'); +can_ok('Net::Upwork::API::Routers::Hr::Clients::Applications', 'get_specific'); diff --git a/t/25.routers_hr_clients_offers.t b/t/25.routers_hr_clients_offers.t new file mode 100644 index 0000000..17f4227 --- /dev/null +++ b/t/25.routers_hr_clients_offers.t @@ -0,0 +1,10 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 4; +use lib qw(lib); +use Net::Upwork::API::Routers::Hr::Clients::Offers; + +can_ok('Net::Upwork::API::Routers::Hr::Clients::Offers', 'new'); +can_ok('Net::Upwork::API::Routers::Hr::Clients::Offers', 'get_list'); +can_ok('Net::Upwork::API::Routers::Hr::Clients::Offers', 'get_specific'); +can_ok('Net::Upwork::API::Routers::Hr::Clients::Offers', 'make_offer'); diff --git a/t/26.routers_hr_freelancers_offers.t b/t/26.routers_hr_freelancers_offers.t new file mode 100644 index 0000000..10f9df4 --- /dev/null +++ b/t/26.routers_hr_freelancers_offers.t @@ -0,0 +1,9 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 3; +use lib qw(lib); +use Net::Upwork::API::Routers::Hr::Freelancers::Applications; + +can_ok('Net::Upwork::API::Routers::Hr::Freelancers::Applications', 'new'); +can_ok('Net::Upwork::API::Routers::Hr::Freelancers::Applications', 'get_list'); +can_ok('Net::Upwork::API::Routers::Hr::Freelancers::Applications', 'get_specific'); diff --git a/t/27.routers_hr_freelancers_applications.t b/t/27.routers_hr_freelancers_applications.t new file mode 100644 index 0000000..001806c --- /dev/null +++ b/t/27.routers_hr_freelancers_applications.t @@ -0,0 +1,10 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 4; +use lib qw(lib); +use Net::Upwork::API::Routers::Hr::Freelancers::Offers; + +can_ok('Net::Upwork::API::Routers::Hr::Freelancers::Offers', 'new'); +can_ok('Net::Upwork::API::Routers::Hr::Freelancers::Offers', 'get_list'); +can_ok('Net::Upwork::API::Routers::Hr::Freelancers::Offers', 'get_specific'); +can_ok('Net::Upwork::API::Routers::Hr::Freelancers::Offers', 'actions'); diff --git a/t/28.routers_reports_time.t b/t/28.routers_reports_time.t new file mode 100644 index 0000000..e2e201a --- /dev/null +++ b/t/28.routers_reports_time.t @@ -0,0 +1,15 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 8; +use lib qw(lib); +use Net::Upwork::API::Routers::Reports::Time; + +can_ok('Net::Upwork::API::Routers::Reports::Time', 'new'); +can_ok('Net::Upwork::API::Routers::Reports::Time', 'get_by_team_full'); +can_ok('Net::Upwork::API::Routers::Reports::Time', 'get_by_team_limited'); +can_ok('Net::Upwork::API::Routers::Reports::Time', 'get_by_agency'); +can_ok('Net::Upwork::API::Routers::Reports::Time', 'get_by_company'); +can_ok('Net::Upwork::API::Routers::Reports::Time', 'get_by_freelancer_limited'); +can_ok('Net::Upwork::API::Routers::Reports::Time', 'get_by_freelancer_full'); +# local +can_ok('Net::Upwork::API::Routers::Reports::Time', 'get_by_type'); diff --git a/t/29.routers_reports_finance_accounts.t b/t/29.routers_reports_finance_accounts.t new file mode 100644 index 0000000..b8952e1 --- /dev/null +++ b/t/29.routers_reports_finance_accounts.t @@ -0,0 +1,9 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 3; +use lib qw(lib); +use Net::Upwork::API::Routers::Reports::Finance::Accounts; + +can_ok('Net::Upwork::API::Routers::Reports::Finance::Accounts', 'new'); +can_ok('Net::Upwork::API::Routers::Reports::Finance::Accounts', 'get_owned'); +can_ok('Net::Upwork::API::Routers::Reports::Finance::Accounts', 'get_specific'); diff --git a/t/30.routers_reports_finance_billings.t b/t/30.routers_reports_finance_billings.t new file mode 100644 index 0000000..8ab85d6 --- /dev/null +++ b/t/30.routers_reports_finance_billings.t @@ -0,0 +1,12 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 6; +use lib qw(lib); +use Net::Upwork::API::Routers::Reports::Finance::Billings; + +can_ok('Net::Upwork::API::Routers::Reports::Finance::Billings', 'new'); +can_ok('Net::Upwork::API::Routers::Reports::Finance::Billings', 'get_by_freelancer'); +can_ok('Net::Upwork::API::Routers::Reports::Finance::Billings', 'get_by_freelancers_team'); +can_ok('Net::Upwork::API::Routers::Reports::Finance::Billings', 'get_by_freelancers_company'); +can_ok('Net::Upwork::API::Routers::Reports::Finance::Billings', 'get_by_buyers_team'); +can_ok('Net::Upwork::API::Routers::Reports::Finance::Billings', 'get_by_buyers_company'); diff --git a/t/31.routers_reports_finance_earnings.t b/t/31.routers_reports_finance_earnings.t new file mode 100644 index 0000000..3c14935 --- /dev/null +++ b/t/31.routers_reports_finance_earnings.t @@ -0,0 +1,12 @@ +#!/usr/bin/env perl +use strict; +use Test::More tests => 6; +use lib qw(lib); +use Net::Upwork::API::Routers::Reports::Finance::Earnings; + +can_ok('Net::Upwork::API::Routers::Reports::Finance::Earnings', 'new'); +can_ok('Net::Upwork::API::Routers::Reports::Finance::Earnings', 'get_by_freelancer'); +can_ok('Net::Upwork::API::Routers::Reports::Finance::Earnings', 'get_by_freelancers_team'); +can_ok('Net::Upwork::API::Routers::Reports::Finance::Earnings', 'get_by_freelancers_company'); +can_ok('Net::Upwork::API::Routers::Reports::Finance::Earnings', 'get_by_buyers_team'); +can_ok('Net::Upwork::API::Routers::Reports::Finance::Earnings', 'get_by_buyers_company');