GitLab-API-v4-0.04000755000765000024 013235441140 12737 5ustar00aranstaff000000000000README100644000765000024 56013235441140 13661 0ustar00aranstaff000000000000GitLab-API-v4-0.04 This archive contains the distribution GitLab-API-v4, version 0.04: A complete GitLab API v4 client. This software is copyright (c) 2018 by Aran Deltac. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v6.008. Changes100644000765000024 171513235441140 14317 0ustar00aranstaff000000000000GitLab-API-v4-0.04Revision history for Perl extension GitLab::API::v4. 0.04 2018-02-03 - Support parameters in the project method. - Allow wide characters when printing the response output in the gitlab-api-v4 script. 0.03 2018-01-12 - Greatly extended authentication and configuration options for the gitlab-api-v4 script; added GitLab::API::v4::Config. - The gitlab-api-v4 script now always outputs JSON (the default was YAML, with the option to pick other formats). - Fixed the fork_project method to hit the correct URL. 0.02 2017-12-15 - Fix double-slashes in URL paths. - Fixed gitlab-api-v4 script to actually work. 0.01 2017-12-11 - Added the sudo method and the sudo_user argument. - Split the token arguments into the access_token and private_token arguments. - Removed the login/email/password arguments as they are not supported by v4. - Many many methods added/removed/renamed/modified. - Imported GitLab::API::v3 @ fb9253c58b68ca1be71feedf12c1d6004c8ba8d6. LICENSE100644000765000024 4365213235441140 14057 0ustar00aranstaff000000000000GitLab-API-v4-0.04This software is copyright (c) 2018 by Aran Deltac. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2018 by Aran Deltac. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2018 by Aran Deltac. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End cpanfile100644000765000024 164213235441140 14527 0ustar00aranstaff000000000000GitLab-API-v4-0.04requires 'strictures' => '2.000003'; requires 'namespace::clean' => '0.27'; requires 'Moo' => '2.003000'; requires 'Types::Standard' => '1.002001'; requires 'Types::Common::String' => '1.002001'; requires 'Types::Common::Numeric' => '1.002001'; requires 'Role::REST::Client' => '0.22'; requires 'Const::Fast' => '0.014'; requires 'URI::Escape' => '1.72'; requires 'Log::Any' => '1.703'; requires 'Try::Tiny' => '0.28'; requires 'Carp' => 0; requires 'Exporter' => 0; requires 'Data::Dumper' => 0; # Used exclusively by gitlab-api-v4 and/or GitLab::API::v4::Config. requires 'Getopt::Long' => 0; requires 'Pod::Usage' => 0; requires 'Log::Any::Adapter' => '1.703'; requires 'Log::Any::Adapter::Screen' => '0.13'; requires 'JSON' => '2.92'; requires 'Path::Tiny' => '0.079'; requires 'IO::Prompter' => '0.004014'; on test => sub { requires 'Test2::V0' => '0.000094'; requires 'Log::Any::Adapter::TAP' => '0.003003'; }; META.yml100644000765000024 237313235441140 14276 0ustar00aranstaff000000000000GitLab-API-v4-0.04--- abstract: 'A complete GitLab API v4 client.' author: - 'Aran Deltac ' build_requires: ExtUtils::MakeMaker: '0' File::Spec: '0' Log::Any::Adapter::TAP: '0.003003' Test2::V0: '0.000094' Test::More: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: GitLab-API-v4 requires: Carp: '0' Const::Fast: '0.014' Data::Dumper: '0' Exporter: '0' Getopt::Long: '0' IO::Prompter: '0.004014' JSON: '2.92' Log::Any: '1.703' Log::Any::Adapter: '1.703' Log::Any::Adapter::Screen: '0.13' Moo: '2.003000' Path::Tiny: '0.079' Pod::Usage: '0' Role::REST::Client: '0.22' Try::Tiny: '0.28' Types::Common::Numeric: '1.002001' Types::Common::String: '1.002001' Types::Standard: '1.002001' URI::Escape: '1.72' namespace::clean: '0.27' strictures: '2.000003' resources: bugtracker: https://github.com/bluefeet/GitLab-API-v4/issues homepage: https://github.com/bluefeet/GitLab-API-v4 repository: https://github.com/bluefeet/GitLab-API-v4.git version: '0.04' x_serialization_backend: 'YAML::Tiny version 1.69' MANIFEST100644000765000024 56613235441140 14140 0ustar00aranstaff000000000000GitLab-API-v4-0.04# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.008. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README bin/gitlab-api-v4 cpanfile lib/GitLab/API/v4.pm lib/GitLab/API/v4/Config.pm lib/GitLab/API/v4/Constants.pm lib/GitLab/API/v4/Paginator.pm lib/GitLab/API/v4/RESTClient.pm t/00-report-prereqs.dd t/00-report-prereqs.t t/regression.t META.json100644000765000024 441513235441140 14445 0ustar00aranstaff000000000000GitLab-API-v4-0.04{ "abstract" : "A complete GitLab API v4 client.", "author" : [ "Aran Deltac " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.008, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "GitLab-API-v4", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { "Test::Pod" : "1.41" } }, "runtime" : { "requires" : { "Carp" : "0", "Const::Fast" : "0.014", "Data::Dumper" : "0", "Exporter" : "0", "Getopt::Long" : "0", "IO::Prompter" : "0.004014", "JSON" : "2.92", "Log::Any" : "1.703", "Log::Any::Adapter" : "1.703", "Log::Any::Adapter::Screen" : "0.13", "Moo" : "2.003000", "Path::Tiny" : "0.079", "Pod::Usage" : "0", "Role::REST::Client" : "0.22", "Try::Tiny" : "0.28", "Types::Common::Numeric" : "1.002001", "Types::Common::String" : "1.002001", "Types::Standard" : "1.002001", "URI::Escape" : "1.72", "namespace::clean" : "0.27", "strictures" : "2.000003" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "Log::Any::Adapter::TAP" : "0.003003", "Test2::V0" : "0.000094", "Test::More" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/bluefeet/GitLab-API-v4/issues" }, "homepage" : "https://github.com/bluefeet/GitLab-API-v4", "repository" : { "type" : "git", "url" : "https://github.com/bluefeet/GitLab-API-v4.git", "web" : "https://github.com/bluefeet/GitLab-API-v4" } }, "version" : "0.04", "x_serialization_backend" : "Cpanel::JSON::XS version 3.0213" } Makefile.PL100644000765000024 466513235441140 15005 0ustar00aranstaff000000000000GitLab-API-v4-0.04# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.008. use strict; use warnings; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "A complete GitLab API v4 client.", "AUTHOR" => "Aran Deltac ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "GitLab-API-v4", "EXE_FILES" => [ "bin/gitlab-api-v4" ], "LICENSE" => "perl", "NAME" => "GitLab::API::v4", "PREREQ_PM" => { "Carp" => 0, "Const::Fast" => "0.014", "Data::Dumper" => 0, "Exporter" => 0, "Getopt::Long" => 0, "IO::Prompter" => "0.004014", "JSON" => "2.92", "Log::Any" => "1.703", "Log::Any::Adapter" => "1.703", "Log::Any::Adapter::Screen" => "0.13", "Moo" => "2.003000", "Path::Tiny" => "0.079", "Pod::Usage" => 0, "Role::REST::Client" => "0.22", "Try::Tiny" => "0.28", "Types::Common::Numeric" => "1.002001", "Types::Common::String" => "1.002001", "Types::Standard" => "1.002001", "URI::Escape" => "1.72", "namespace::clean" => "0.27", "strictures" => "2.000003" }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Log::Any::Adapter::TAP" => "0.003003", "Test2::V0" => "0.000094", "Test::More" => 0 }, "VERSION" => "0.04", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Const::Fast" => "0.014", "Data::Dumper" => 0, "Exporter" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Getopt::Long" => 0, "IO::Prompter" => "0.004014", "JSON" => "2.92", "Log::Any" => "1.703", "Log::Any::Adapter" => "1.703", "Log::Any::Adapter::Screen" => "0.13", "Log::Any::Adapter::TAP" => "0.003003", "Moo" => "2.003000", "Path::Tiny" => "0.079", "Pod::Usage" => 0, "Role::REST::Client" => "0.22", "Test2::V0" => "0.000094", "Test::More" => 0, "Try::Tiny" => "0.28", "Types::Common::Numeric" => "1.002001", "Types::Common::String" => "1.002001", "Types::Standard" => "1.002001", "URI::Escape" => "1.72", "namespace::clean" => "0.27", "strictures" => "2.000003" ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); t000755000765000024 013235441140 13123 5ustar00aranstaff000000000000GitLab-API-v4-0.04regression.t100644000765000024 160313235441140 15630 0ustar00aranstaff000000000000GitLab-API-v4-0.04/t#!/usr/bin/env perl use strictures 2; use Test2::V0; BEGIN { plan skip_all => 'Set the AUTHOR_TESTING env var to run this test.' unless $ENV{AUTHOR_TESTING}; } use Log::Any::Adapter 'TAP'; use GitLab::API::v4; use GitLab::API::v4::Config; my $config = GitLab::API::v4::Config->new(); my $api = GitLab::API::v4->new( $config->args() ); my $stamp = time(); my $project_name = "tester-$stamp"; my $created_project = $api->create_project( { name=>$project_name }, ); ok( $created_project, 'project created' ); my $project_id = $created_project->{id}; my $found_project = $api->project( $project_id ); ok( $found_project, 'project found' ); $api->delete_project( $project_id ); my $tries = 0; while ($api->project( $project_id )) { $tries ++; die 'Timed out waiting for project to delete' if $tries > 10; sleep 1; } ok( 1, 'project deleted' ); done_testing; bin000755000765000024 013235441140 13430 5ustar00aranstaff000000000000GitLab-API-v4-0.04gitlab-api-v4100755000765000024 742013235441140 16061 0ustar00aranstaff000000000000GitLab-API-v4-0.04/bin#!/usr/bin/env perl use strictures 2; use GitLab::API::v4; use GitLab::API::v4::Constants qw( :all ); use GitLab::API::v4::Config; use Log::Any qw( $log ); use Log::Any::Adapter; use Log::Any::Adapter::Screen; use Try::Tiny; use JSON; use Getopt::Long; use Pod::Usage qw( pod2usage ); Getopt::Long::Configure('pass_through'); GetOptions( 'all' => \my $all, 'help' => \my $help, 'verbose' => \my $verbose, 'quiet' => \my $quiet, ) or fail('Unable to process options!'); if ($help or @ARGV and $ARGV[0] eq 'help') { pod2usage( -verbose => 2 ); exit 0; } my $min_level = 'info'; $min_level = 'trace' if $verbose; $min_level = 'error' if $quiet; my $config = GitLab::API::v4::Config->new(); Log::Any::Adapter->set( 'Screen', min_level => $min_level, stderr => 1, ); my $access_levels = { '--access-level-guest' => $GITLAB_ACCESS_LEVEL_GUEST, '--access-level-reporter' => $GITLAB_ACCESS_LEVEL_REPORTER, '--access-level-developer' => $GITLAB_ACCESS_LEVEL_DEVELOPER, '--access-level-master' => $GITLAB_ACCESS_LEVEL_MASTER, '--access-level-owner' => $GITLAB_ACCESS_LEVEL_OWNER, }; my @args; my $params = {}; foreach my $arg (@ARGV) { if (defined $access_levels->{$arg}) { $params->{access_level} = $access_levels->{$arg}; } elsif ($arg =~ m{^--(no-|)?([^\s=]+)(=(\S+)|)$}) { my ($no, $key, $has_value, $value) = ($1, $2, $3, $4); $key =~ s{-}{_}g; $value = $has_value ? $value : $no ? 0 : 1; $params->{$key} = $value; } else { push @args, $arg; } } my $method = shift( @args ); fail( 'No method was specified.' ) if !$method; $method =~ s{-}{_}g; if ($method eq 'configure') { $config->configure(); exit; } try { my $api = GitLab::API::v4->new( $config->args() ); if ($all) { @args = ( $method, @args ); $method = 'paginator'; } my $data = $api->$method( @args, %$params ? $params : (), ); $data = $data->all() if $all; binmode STDOUT, ':utf8'; my $json = JSON->new->allow_nonref(); print $json->encode( $data ); } catch { fail( $_ ); }; sub fail { $log->fatal( @_ ); exit 1; } __END__ =head1 NAME gitlab-api-v4 - Command line interface to the GitLab API v4. =head1 SYNOPSIS # Generally: gitlab-api-v4 [ ...] [--= ...] # List all groups: gitlab-api-v4 groups # List information about a project: gitlab-api-v4 project # Create an admin user: gitlab-api-v4 create-user \ --email= --password= --username= --name= --admin =head1 CONFIGURING You may configure this module with envornment variables, command line options, and a configuration file. To setup the configuration file run: gitlab-api-v4 configure This will ask several interactive questions to help you configure this script. The information, which may include GitLab authentication tokens, is stored in C<~/.gitlab-api-v4.json>. Read more at L. =head1 OPTIONS =head2 method The API method to call (one of the methods documented in L). =head2 args ... Any arguments that the L requires. =head2 params --= ... Any parameters that the L accepts. =head2 access level --access-level-guest --access-level-reporter --access-level-developer --access-level-master --access-level-owner =head2 all --all Retrieves all results when the results would normally be paged. =head1 AUTHORS See L and L. =head1 LICENSE This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself. API000755000765000024 013235441140 15201 5ustar00aranstaff000000000000GitLab-API-v4-0.04/lib/GitLabv4.pm100644000765000024 105230413235441140 16315 0ustar00aranstaff000000000000GitLab-API-v4-0.04/lib/GitLab/APIpackage GitLab::API::v4; $GitLab::API::v4::VERSION = '0.04'; =encoding utf8 =head1 NAME GitLab::API::v4 - A complete GitLab API v4 client. =head1 SYNOPSIS use GitLab::API::v4; my $api = GitLab::API::v4->new( url => $v4_api_url, private_token => $token, ); my $branches = $api->branches( $project_id ); =head1 DESCRIPTION This module provides a one-to-one interface with the GitLab API v4. Much is not documented here as it would just be duplicating GitLab's own L. Note that this distribution also includes the L command-line interface (CLI). =head2 UPGRADING If you are upgrading from L make sure you read: L Also, review the C file included in the distribution as it outlines the changes made to convert the v3 module to v4: L Finally, be aware that many methods were added, removed, renamed, and/or altered. If you want to review exactly what was changed you can use GitHub's compare tool: L Or clone the repo and run this command: C =head2 CREDENTIALS Authentication credentials may be defined by setting either the L or L arguments. If no credentials are supplied then the client will be anonymous and greatly limited in what it can do with the API. =head2 CONSTANTS The GitLab API, in rare cases, uses a numeric value to represent a state. To make life easier the L module exposes these states as named variables. =head2 EXCEPTIONS The API methods will all throw (hopefully) a useful exception if an unsuccessful response is received from the API. That is except for C requests that return a C<404> response - these will return C for methods that return a value. If you'd like to catch and handle these exceptions consider using L. =head2 LOGGING This module uses L and produces some debug messages here and there, but the most useful bits are the info messages produced just before each API call. =head2 PROJECT ID Note that many API calls require a C<$project_id>. This can be specified as either a numeric project C, or as a C in many cases. Perhaps even all cases, but the GitLab documentation on this point is vague. =cut use GitLab::API::v4::RESTClient; use GitLab::API::v4::Paginator; use Types::Standard -types; use Types::Common::String -types; use Types::Common::Numeric -types; use URI::Escape; use Carp qw( croak ); use Log::Any qw( $log ); use Try::Tiny; use Moo; use strictures 2; use namespace::clean; sub BUILD { my ($self) = @_; $log->debugf( "An instance of %s has been created.", ref($self) ); return; } sub _clone_args { my ($self) = @_; return { url => $self->url(), retries => $self->retries(), rest_client => $self->rest_client(), $self->_has_access_token() ? (access_token=>$self->access_token()) : (), $self->_has_private_token() ? (private_token=>$self->private_token()) : (), }; } sub _clone { my $self = shift; my $class = ref $self; my $args = { %{ $self->_clone_args() }, %{ $class->BUILDARGS( @_ ) }, }; return $class->new( $args ); } sub _set_headers { my ($self) = @_; $self->rest_client->set_header( 'Authorization' => 'Bearer ' . $self->access_token(), ) if $self->_has_access_token(); $self->rest_client->set_header( 'Private-Token' => $self->private_token(), ) if $self->_has_private_token(); $self->rest_client->set_header( 'Sudo' => $self->sudo_user(), ) if $self->_has_sudo_user(); return; } sub _call_rest_method { my ($self, $method, @args) = @_; $self->_set_headers(); my (@ret, $errored, $error); try { @ret = $self->rest_client->$method( @args ) } catch { ($errored,$error) = (1,$_) }; $self->rest_client->clear_headers(); die $error if $errored; return wantarray() ? @ret : $ret[0]; } =head1 REQUIRED ARGUMENTS =head2 url The URL to your v4 API endpoint. Typically this will be something like C. =cut has url => ( is => 'ro', isa => NonEmptySimpleStr, required => 1, ); =head1 OPTIONAL ARGUMENTS =head2 access_token A GitLab API OAuth2 token. If set then L may not be set. See L. =cut has access_token => ( is => 'ro', isa => NonEmptySimpleStr, predicate => '_has_access_token', ); =head2 private_token A GitLab API personal token. If set then L may not be set. See L. =cut has private_token => ( is => 'ro', isa => NonEmptySimpleStr, predicate => '_has_private_token', ); =head2 sudo_user The user to execute API calls as. You may find it more useful to use the L method instead. See L. =cut has sudo_user => ( is => 'ro', isa => NonEmptySimpleStr, predicate => '_has_sudo_user', ); =head2 retries The number of times the request should be retried in case it does not succeed. Defaults to C<0> (false), meaning that a failed request will not be retried. =cut has retries => ( is => 'ro', isa => PositiveOrZeroInt, default => 0, ); =head2 rest_client An instance of L. Typically you will not be setting this as it defaults to a new instance and customization should not be necessary. =cut has rest_client => ( is => 'lazy', isa => InstanceOf[ 'GitLab::API::v4::RESTClient' ], ); sub _build_rest_client { my ($self) = @_; my $url = '' . $self->url(); my $class = 'GitLab::API::v4::RESTClient'; $log->debugf( 'Creating a %s instance pointed at %s.', $class, $url ); my $rest = $class->new( server => $url, type => 'application/json', retries => $self->retries, ); return $rest; } =head1 UTILITY METHODS =head2 paginator my $paginator = $api->paginator( $method, @method_args ); my $members = $api->paginator('group_members', $group_id); while (my $member = $members->next()) { ... } my $users_pager = $api->paginator('users'); while (my $users = $users_pager->next_page()) { ... } my $all_open_issues = $api->paginator( 'issues', $project_id, { state=>'opened' }, )->all(); Given a method who supports the C and C parameters, and returns an array ref, this will return a L object that will allow you to walk the records one page or one record at a time. =cut sub paginator { my ($self, $method, @args) = @_; my $params = (ref($args[-1]) eq 'HASH') ? pop(@args) : {}; return GitLab::API::v4::Paginator->new( api => $self, method => $method, args => \@args, params => $params, ); } =head2 sudo $api->sudo('fred')->create_issue(...); Returns a new instance of L with the L argument set. See L. =cut sub sudo { my ($self, $user) = @_; return $self->_clone( sudo_user => $user, ); } =head1 AWARD EMOJI METHODS See L. =head2 issue_award_emojis my $award_emojis = $api->issue_award_emojis( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub issue_award_emojis { my $self = shift; croak 'issue_award_emojis must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to issue_award_emojis must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_award_emojis must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/issues/%s/award_emoji', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 merge_request_award_emojis my $award_emojis = $api->merge_request_award_emojis( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub merge_request_award_emojis { my $self = shift; croak 'merge_request_award_emojis must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to merge_request_award_emojis must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_award_emojis must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s/award_emoji', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 snippet_award_emojis my $award_emojis = $api->snippet_award_emojis( $project_id, $merge_request_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub snippet_award_emojis { my $self = shift; croak 'snippet_award_emojis must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to snippet_award_emojis must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_id) to snippet_award_emojis must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s/award_emoji', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 issue_award_emoji my $award_emoji = $api->issue_award_emoji( $project_id, $issue_iid, $award_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub issue_award_emoji { my $self = shift; croak 'issue_award_emoji must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to issue_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($award_id) to issue_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/issues/%s/award_emoji/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 merge_request_award_emoji my $award_emoji = $api->merge_request_award_emoji( $project_id, $merge_request_iid, $award_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub merge_request_award_emoji { my $self = shift; croak 'merge_request_award_emoji must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to merge_request_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($award_id) to merge_request_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/merge_requests/%s/award_emoji/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 snippet_award_emoji my $award_emoji = $api->snippet_award_emoji( $project_id, $snippet_id, $award_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub snippet_award_emoji { my $self = shift; croak 'snippet_award_emoji must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to snippet_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to snippet_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($award_id) to snippet_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/snippets/%s/award_emoji/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_issue_award_emoji my $award_emoji = $api->create_issue_award_emoji( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_issue_award_emoji { my $self = shift; croak 'create_issue_award_emoji must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_issue_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to create_issue_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_issue_award_emoji must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/issues/%s/award_emoji', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 create_merge_request_award_emoji my $award_emoji = $api->create_merge_request_award_emoji( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_merge_request_award_emoji { my $self = shift; croak 'create_merge_request_award_emoji must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_merge_request_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to create_merge_request_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_merge_request_award_emoji must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/merge_requests/%s/award_emoji', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 create_snippet_award_emoji my $award_emoji = $api->create_snippet_award_emoji( $project_id, $snippet_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_snippet_award_emoji { my $self = shift; croak 'create_snippet_award_emoji must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to create_snippet_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to create_snippet_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/snippets/%s/award_emoji', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 delete_issue_award_emoji my $award_emoji = $api->delete_issue_award_emoji( $project_id, $issue_id, $award_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub delete_issue_award_emoji { my $self = shift; croak 'delete_issue_award_emoji must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_issue_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_id) to delete_issue_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($award_id) to delete_issue_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/issues/%s/award_emoji/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'delete', $path ); } =head2 delete_merge_request_award_emoji my $award_emoji = $api->delete_merge_request_award_emoji( $project_id, $merge_request_id, $award_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub delete_merge_request_award_emoji { my $self = shift; croak 'delete_merge_request_award_emoji must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_merge_request_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_id) to delete_merge_request_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($award_id) to delete_merge_request_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/merge_requests/%s/award_emoji/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'delete', $path ); } =head2 delete_snippet_award_emoji my $award_emoji = $api->delete_snippet_award_emoji( $project_id, $snippet_id, $award_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub delete_snippet_award_emoji { my $self = shift; croak 'delete_snippet_award_emoji must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_snippet_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to delete_snippet_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($award_id) to delete_snippet_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/snippets/%s/award_emoji/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'delete', $path ); } =head2 issue_note_award_emojis my $award_emojis = $api->issue_note_award_emojis( $project_id, $issue_iid, $note_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub issue_note_award_emojis { my $self = shift; croak 'issue_note_award_emojis must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to issue_note_award_emojis must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_note_award_emojis must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to issue_note_award_emojis must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/issues/%s/notes/%s/award_emoji', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 issue_note_award_emoji my $award_emoji = $api->issue_note_award_emoji( $project_id, $issue_iid, $note_id, $award_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub issue_note_award_emoji { my $self = shift; croak 'issue_note_award_emoji must be called with 4 arguments' if @_ != 4; croak 'The #1 argument ($project_id) to issue_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to issue_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($award_id) to issue_note_award_emoji must be a scalar' if ref($_[3]) or (!defined $_[3]); my $path = sprintf('projects/%s/issues/%s/notes/%s/award_emoji/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_issue_note_award_emoji my $award_emoji = $api->create_issue_note_award_emoji( $project_id, $issue_iid, $note_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_issue_note_award_emoji { my $self = shift; croak 'create_issue_note_award_emoji must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to create_issue_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to create_issue_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to create_issue_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to create_issue_note_award_emoji must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $path = sprintf('projects/%s/issues/%s/notes/%s/award_emoji', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 delete_issue_note_award_emoji my $award_emoji = $api->delete_issue_note_award_emoji( $project_id, $issue_iid, $note_id, $award_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub delete_issue_note_award_emoji { my $self = shift; croak 'delete_issue_note_award_emoji must be called with 4 arguments' if @_ != 4; croak 'The #1 argument ($project_id) to delete_issue_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to delete_issue_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to delete_issue_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($award_id) to delete_issue_note_award_emoji must be a scalar' if ref($_[3]) or (!defined $_[3]); my $path = sprintf('projects/%s/issues/%s/notes/%s/award_emoji/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'delete', $path ); } =head2 merge_request_note_award_emojis my $award_emojis = $api->merge_request_note_award_emojis( $project_id, $merge_request_iid, $note_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub merge_request_note_award_emojis { my $self = shift; croak 'merge_request_note_award_emojis must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to merge_request_note_award_emojis must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_note_award_emojis must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to merge_request_note_award_emojis must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/merge_requests/%s/notes/%s/award_emoji', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 merge_request_note_award_emoji my $award_emoji = $api->merge_request_note_award_emoji( $project_id, $merge_request_iid, $note_id, $award_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub merge_request_note_award_emoji { my $self = shift; croak 'merge_request_note_award_emoji must be called with 4 arguments' if @_ != 4; croak 'The #1 argument ($project_id) to merge_request_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to merge_request_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($award_id) to merge_request_note_award_emoji must be a scalar' if ref($_[3]) or (!defined $_[3]); my $path = sprintf('projects/%s/merge_requests/%s/notes/%s/award_emoji/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_merge_request_note_award_emoji my $award_emoji = $api->create_merge_request_note_award_emoji( $project_id, $merge_request_iid, $note_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_merge_request_note_award_emoji { my $self = shift; croak 'create_merge_request_note_award_emoji must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to create_merge_request_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to create_merge_request_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to create_merge_request_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to create_merge_request_note_award_emoji must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $path = sprintf('projects/%s/merge_requests/%s/notes/%s/award_emoji', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 delete_merge_request_note_award_emoji my $award_emoji = $api->delete_merge_request_note_award_emoji( $project_id, $merge_request_iid, $note_id, $award_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub delete_merge_request_note_award_emoji { my $self = shift; croak 'delete_merge_request_note_award_emoji must be called with 4 arguments' if @_ != 4; croak 'The #1 argument ($project_id) to delete_merge_request_note_award_emoji must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to delete_merge_request_note_award_emoji must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to delete_merge_request_note_award_emoji must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The #4 argument ($award_id) to delete_merge_request_note_award_emoji must be a scalar' if ref($_[3]) or (!defined $_[3]); my $path = sprintf('projects/%s/merge_requests/%s/notes/%s/award_emoji/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'delete', $path ); } =head1 BRANCH METHODS See L. =head2 branches my $branches = $api->branches( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub branches { my $self = shift; croak 'branches must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to branches must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/repository/branches', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 branch my $branch = $api->branch( $project_id, $branch_name, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub branch { my $self = shift; croak 'branch must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to branch must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($branch_name) to branch must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/repository/branches/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_branch my $branch = $api->create_branch( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_branch { my $self = shift; croak 'create_branch must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_branch must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_branch must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/repository/branches', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 delete_branch $api->delete_branch( $project_id, $branch_name, ); Sends a C request to C. =cut sub delete_branch { my $self = shift; croak 'delete_branch must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_branch must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($branch_name) to delete_branch must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/repository/branches/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 delete_merged_branches $api->delete_merged_branches( $project_id, ); Sends a C request to C. =cut sub delete_merged_branches { my $self = shift; croak 'delete_merged_branches must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to delete_merged_branches must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/repository/merged_branches', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 BROADCAST MESSAGE METHODS See L. =head2 broadcast_messages my $messages = $api->broadcast_messages(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub broadcast_messages { my $self = shift; croak "The broadcast_messages method does not take any arguments" if @_; my $path = sprintf('broadcast_messages', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 broadcast_message my $message = $api->broadcast_message( $message_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub broadcast_message { my $self = shift; croak 'broadcast_message must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($message_id) to broadcast_message must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('broadcast_messages/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_broadcast_message my $message = $api->create_broadcast_message( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_broadcast_message { my $self = shift; croak 'create_broadcast_message must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_broadcast_message must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('broadcast_messages', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_broadcast_message my $message = $api->edit_broadcast_message( $message_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_broadcast_message { my $self = shift; croak 'edit_broadcast_message must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($message_id) to edit_broadcast_message must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to edit_broadcast_message must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('broadcast_messages/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 delete_broadcast_message $api->delete_broadcast_message( $message_id, ); Sends a C request to C. =cut sub delete_broadcast_message { my $self = shift; croak 'delete_broadcast_message must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($message_id) to delete_broadcast_message must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('broadcast_messages/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 PROJECT LEVEL VARIABLE METHODS See L. =head2 project_variables my $variables = $api->project_variables( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_variables { my $self = shift; croak 'project_variables must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to project_variables must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/variables', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 project_variable my $variable = $api->project_variable( $project_id, $variable_key, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_variable { my $self = shift; croak 'project_variable must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($variable_key) to project_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/variables/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_project_variable my $variable = $api->create_project_variable( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_project_variable { my $self = shift; croak 'create_project_variable must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_project_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_project_variable must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/variables', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_project_variable my $variable = $api->edit_project_variable( $project_id, $variable_key, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_project_variable { my $self = shift; croak 'edit_project_variable must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_project_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($variable_key) to edit_project_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_project_variable must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/variables/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 delete_project_variable $api->delete_project_variable( $project_id, $variable_key, ); Sends a C request to C. =cut sub delete_project_variable { my $self = shift; croak 'delete_project_variable must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_project_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($variable_key) to delete_project_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/variables/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 GROUP LEVEL VARIABLE METHODS See L. =head2 group_variables my $variables = $api->group_variables( $group_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub group_variables { my $self = shift; croak 'group_variables must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to group_variables must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('groups/%s/variables', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 group_variable my $variable = $api->group_variable( $group_id, $variable_key, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub group_variable { my $self = shift; croak 'group_variable must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to group_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($variable_key) to group_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('groups/%s/variables/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_group_variable my $variable = $api->create_group_variable( $group_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_group_variable { my $self = shift; croak 'create_group_variable must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to create_group_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_group_variable must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('groups/%s/variables', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_group_variable my $variable = $api->edit_group_variable( $group_id, $variable_key, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_group_variable { my $self = shift; croak 'edit_group_variable must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($group_id) to edit_group_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($variable_key) to edit_group_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_group_variable must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('groups/%s/variables/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 delete_group_variable $api->delete_group_variable( $group_id, $variable_key, ); Sends a C request to C. =cut sub delete_group_variable { my $self = shift; croak 'delete_group_variable must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to delete_group_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($variable_key) to delete_group_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('groups/%s/variables/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 COMMIT METHODS See L. =head2 commits my $commits = $api->commits( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub commits { my $self = shift; croak 'commits must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to commits must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to commits must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/repository/commits', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 create_commit my $commit = $api->create_commit( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_commit { my $self = shift; croak 'create_commit must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_commit must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_commit must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/repository/commits', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 commit my $commit = $api->commit( $project_id, $commit_sha, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub commit { my $self = shift; croak 'commit must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to commit must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to commit must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/repository/commits/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 cherry_pick_commit my $commit = $api->cherry_pick_commit( $project_id, $commit_sha, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub cherry_pick_commit { my $self = shift; croak 'cherry_pick_commit must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to cherry_pick_commit must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to cherry_pick_commit must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to cherry_pick_commit must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/repository/commits/%s/cherry_pick', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 commit_diff my $diff = $api->commit_diff( $project_id, $commit_sha, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub commit_diff { my $self = shift; croak 'commit_diff must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to commit_diff must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to commit_diff must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/repository/commits/%s/diff', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 commit_comments my $comments = $api->commit_comments( $project_id, $commit_sha, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub commit_comments { my $self = shift; croak 'commit_comments must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to commit_comments must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to commit_comments must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/repository/commits/%s/comments', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_commit_comment $api->create_commit_comment( $project_id, $commit_sha, \%params, ); Sends a C request to C. =cut sub create_commit_comment { my $self = shift; croak 'create_commit_comment must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_commit_comment must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to create_commit_comment must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_commit_comment must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/repository/commits/%s/comments', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 commit_statuses my $build_statuses = $api->commit_statuses( $project_id, $commit_sha, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub commit_statuses { my $self = shift; croak 'commit_statuses must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to commit_statuses must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to commit_statuses must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to commit_statuses must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/repository/commits/%s/statuses', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 create_commit_status my $build_status = $api->create_commit_status( $project_id, $commit_sha, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_commit_status { my $self = shift; croak 'create_commit_status must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_commit_status must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($commit_sha) to create_commit_status must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_commit_status must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/statuses/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head1 CUSTOM ATTRIBUTE METHODS See L. =head2 custom_user_attributes my $attributes = $api->custom_user_attributes( $user_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub custom_user_attributes { my $self = shift; croak 'custom_user_attributes must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($user_id) to custom_user_attributes must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('users/%s/custom_attributes', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 custom_group_attributes my $attributes = $api->custom_group_attributes( $group_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub custom_group_attributes { my $self = shift; croak 'custom_group_attributes must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to custom_group_attributes must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('groups/%s/custom_attributes', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 custom_project_attributes my $attributes = $api->custom_project_attributes( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub custom_project_attributes { my $self = shift; croak 'custom_project_attributes must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to custom_project_attributes must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/custom_attributes', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 custom_user_attribute my $attribute = $api->custom_user_attribute( $user_id, $attribute_key, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub custom_user_attribute { my $self = shift; croak 'custom_user_attribute must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to custom_user_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to custom_user_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('users/%s/custom_attributes/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 custom_group_attribute my $attribute = $api->custom_group_attribute( $group_id, $attribute_key, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub custom_group_attribute { my $self = shift; croak 'custom_group_attribute must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to custom_group_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to custom_group_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('groups/%s/custom_attributes/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 custom_project_attribute my $attribute = $api->custom_project_attribute( $project_id, $attribute_key, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub custom_project_attribute { my $self = shift; croak 'custom_project_attribute must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to custom_project_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to custom_project_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/custom_attributes/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 set_custom_user_attribute my $attribute = $api->set_custom_user_attribute( $user_id, $attribute_key, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub set_custom_user_attribute { my $self = shift; croak 'set_custom_user_attribute must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($user_id) to set_custom_user_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to set_custom_user_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to set_custom_user_attribute must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('users/%s/custom_attributes/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 set_custom_group_attribute my $attribute = $api->set_custom_group_attribute( $group_id, $attribute_key, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub set_custom_group_attribute { my $self = shift; croak 'set_custom_group_attribute must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($group_id) to set_custom_group_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to set_custom_group_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to set_custom_group_attribute must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('groups/%s/custom_attributes/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 set_custom_project_attribute my $attribute = $api->set_custom_project_attribute( $project_id, $attribute_key, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub set_custom_project_attribute { my $self = shift; croak 'set_custom_project_attribute must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to set_custom_project_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to set_custom_project_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to set_custom_project_attribute must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/custom_attributes/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 delete_custom_user_attribute $api->delete_custom_user_attribute( $user_id, $attribute_key, ); Sends a C request to C. =cut sub delete_custom_user_attribute { my $self = shift; croak 'delete_custom_user_attribute must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to delete_custom_user_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to delete_custom_user_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('users/%s/custom_attributes/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 delete_custom_group_attribute $api->delete_custom_group_attribute( $group_id, $attribute_key, ); Sends a C request to C. =cut sub delete_custom_group_attribute { my $self = shift; croak 'delete_custom_group_attribute must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to delete_custom_group_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to delete_custom_group_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('groups/%s/custom_attributes/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 delete_custom_project_attribute $api->delete_custom_project_attribute( $project_id, $attribute_key, ); Sends a C request to C. =cut sub delete_custom_project_attribute { my $self = shift; croak 'delete_custom_project_attribute must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_custom_project_attribute must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($attribute_key) to delete_custom_project_attribute must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/custom_attributes/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 DEPLOYMENT METHODS See L. =head2 deployments my $deployments = $api->deployments( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub deployments { my $self = shift; croak 'deployments must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to deployments must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/deployments', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 deployment my $deployment = $api->deployment( $project_id, $deployment_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub deployment { my $self = shift; croak 'deployment must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to deployment must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($deployment_id) to deployment must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/deployments/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head1 DEPLOY KEY METHODS See L. =head2 all_deploy_keys my $keys = $api->all_deploy_keys(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub all_deploy_keys { my $self = shift; croak "The all_deploy_keys method does not take any arguments" if @_; my $path = sprintf('deploy_keys', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 deploy_keys my $keys = $api->deploy_keys( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub deploy_keys { my $self = shift; croak 'deploy_keys must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to deploy_keys must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/deploy_keys', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 deploy_key my $key = $api->deploy_key( $project_id, $key_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub deploy_key { my $self = shift; croak 'deploy_key must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to deploy_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($key_id) to deploy_key must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/deploy_keys/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_deploy_key my $key = $api->create_deploy_key( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_deploy_key { my $self = shift; croak 'create_deploy_key must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_deploy_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_deploy_key must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/deploy_keys', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 delete_deploy_key $api->delete_deploy_key( $project_id, $key_id, ); Sends a C request to C. =cut sub delete_deploy_key { my $self = shift; croak 'delete_deploy_key must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_deploy_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($key_id) to delete_deploy_key must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/deploy_keys/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 enable_deploy_key my $key = $api->enable_deploy_key( $project_id, $key_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub enable_deploy_key { my $self = shift; croak 'enable_deploy_key must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to enable_deploy_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($key_id) to enable_deploy_key must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/deploy_keys/%s/enable', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head1 ENVIRONMENT METHODS See L. =head2 environments my $environments = $api->environments( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub environments { my $self = shift; croak 'environments must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to environments must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/environments', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_environment my $environment = $api->create_environment( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_environment { my $self = shift; croak 'create_environment must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_environment must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_environment must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/environments', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_environment my $environment = $api->edit_environment( $project_id, $environments_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_environment { my $self = shift; croak 'edit_environment must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_environment must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($environments_id) to edit_environment must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_environment must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/environments/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 delete_environment $api->delete_environment( $project_id, $environment_id, ); Sends a C request to C. =cut sub delete_environment { my $self = shift; croak 'delete_environment must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_environment must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($environment_id) to delete_environment must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/environments/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 stop_environment my $environment = $api->stop_environment( $project_id, $environment_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub stop_environment { my $self = shift; croak 'stop_environment must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to stop_environment must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($environment_id) to stop_environment must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/environments/%s/stop', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head1 EVENT METHODS See L. =head2 all_events my $events = $api->all_events( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub all_events { my $self = shift; croak 'all_events must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to all_events must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('events', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 user_events my $events = $api->user_events( $user_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub user_events { my $self = shift; croak 'user_events must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to user_events must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to user_events must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('users/%s/events', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 project_events my $events = $api->project_events( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_events { my $self = shift; croak 'project_events must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project_events must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project_events must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/events', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head1 FEATURE FLAG METHODS See L. =head2 features my $features = $api->features(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub features { my $self = shift; croak "The features method does not take any arguments" if @_; my $path = sprintf('features', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 set_feature my $feature = $api->set_feature( $name, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub set_feature { my $self = shift; croak 'set_feature must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($name) to set_feature must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to set_feature must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('features/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head1 GITIGNORES TEMPLATE METHODS See L. =head2 gitignores_templates my $templates = $api->gitignores_templates(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub gitignores_templates { my $self = shift; croak "The gitignores_templates method does not take any arguments" if @_; my $path = sprintf('templates/gitignores', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 gitignores_template my $template = $api->gitignores_template( $template_key, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub gitignores_template { my $self = shift; croak 'gitignores_template must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($template_key) to gitignores_template must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('templates/gitignores/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head1 GITLAB CI CONFIG TEMPLATE METHODS See L. =head2 gitlab_ci_ymls_templates my $templates = $api->gitlab_ci_ymls_templates(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub gitlab_ci_ymls_templates { my $self = shift; croak "The gitlab_ci_ymls_templates method does not take any arguments" if @_; my $path = sprintf('templates/gitlab_ci_ymls', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 gitlab_ci_ymls_template my $template = $api->gitlab_ci_ymls_template( $template_key, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub gitlab_ci_ymls_template { my $self = shift; croak 'gitlab_ci_ymls_template must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($template_key) to gitlab_ci_ymls_template must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('templates/gitlab_ci_ymls/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head1 GROUP METHODS See L. =head2 groups my $groups = $api->groups( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub groups { my $self = shift; croak 'groups must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to groups must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('groups', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 group_subgroups my $subgroups = $api->group_subgroups( $group_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub group_subgroups { my $self = shift; croak 'group_subgroups must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to group_subgroups must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to group_subgroups must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('groups/%s/subgroups', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 group_projects my $projects = $api->group_projects( $group_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub group_projects { my $self = shift; croak 'group_projects must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to group_projects must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to group_projects must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('groups/%s/projects', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 group my $group = $api->group( $group_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub group { my $self = shift; croak 'group must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to group must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('groups/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_group $api->create_group( \%params, ); Sends a C request to C. =cut sub create_group { my $self = shift; croak 'create_group must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_group must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('groups', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 transfer_project_to_group $api->transfer_project_to_group( $group_id, $project_id, ); Sends a C request to C. =cut sub transfer_project_to_group { my $self = shift; croak 'transfer_project_to_group must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to transfer_project_to_group must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($project_id) to transfer_project_to_group must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('groups/%s/projects/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path ); return; } =head2 edit_group my $group = $api->edit_group( $group_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_group { my $self = shift; croak 'edit_group must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to edit_group must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to edit_group must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('groups/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 delete_group $api->delete_group( $group_id, ); Sends a C request to C. =cut sub delete_group { my $self = shift; croak 'delete_group must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to delete_group must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('groups/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 sync_group_with_ldap $api->sync_group_with_ldap( $group_id, ); Sends a C request to C. =cut sub sync_group_with_ldap { my $self = shift; croak 'sync_group_with_ldap must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to sync_group_with_ldap must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('groups/%s/ldap_sync', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path ); return; } =head2 create_ldap_group_link $api->create_ldap_group_link( $group_id, \%params, ); Sends a C request to C. =cut sub create_ldap_group_link { my $self = shift; croak 'create_ldap_group_link must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to create_ldap_group_link must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_ldap_group_link must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('groups/%s/ldap_group_links', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 delete_ldap_group_link $api->delete_ldap_group_link( $group_id, $cn, ); Sends a C request to C. =cut sub delete_ldap_group_link { my $self = shift; croak 'delete_ldap_group_link must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to delete_ldap_group_link must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($cn) to delete_ldap_group_link must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('groups/%s/ldap_group_links/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 delete_ldap_provider_group_link $api->delete_ldap_provider_group_link( $group_id, $provider, $cn, ); Sends a C request to C. =cut sub delete_ldap_provider_group_link { my $self = shift; croak 'delete_ldap_provider_group_link must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($group_id) to delete_ldap_provider_group_link must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($provider) to delete_ldap_provider_group_link must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($cn) to delete_ldap_provider_group_link must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('groups/%s/ldap_group_links/%s/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 GROUP AND PROJECT MEMBER METHODS See L. =head2 group_members my $members = $api->group_members( $group_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub group_members { my $self = shift; croak 'group_members must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to group_members must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to group_members must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('groups/%s/members', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 project_members my $members = $api->project_members( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_members { my $self = shift; croak 'project_members must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project_members must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project_members must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/members', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 group_member my $member = $api->group_member( $project_id, $user_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub group_member { my $self = shift; croak 'group_member must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to group_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to group_member must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('groups/%s/members/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 project_member my $member = $api->project_member( $project_id, $user_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_member { my $self = shift; croak 'project_member must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to project_member must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/members/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 add_group_member my $member = $api->add_group_member( $group_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub add_group_member { my $self = shift; croak 'add_group_member must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to add_group_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to add_group_member must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('groups/%s/members', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 add_project_member my $member = $api->add_project_member( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub add_project_member { my $self = shift; croak 'add_project_member must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to add_project_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to add_project_member must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/members', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 update_group_member my $member = $api->update_group_member( $group_id, $user_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub update_group_member { my $self = shift; croak 'update_group_member must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($group_id) to update_group_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to update_group_member must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to update_group_member must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('groups/%s/members/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 update_project_member my $member = $api->update_project_member( $project_id, $user_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub update_project_member { my $self = shift; croak 'update_project_member must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to update_project_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to update_project_member must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to update_project_member must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/members/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 remove_group_member $api->remove_group_member( $group_id, $user_id, ); Sends a C request to C. =cut sub remove_group_member { my $self = shift; croak 'remove_group_member must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to remove_group_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to remove_group_member must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('groups/%s/members/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 remove_project_member $api->remove_project_member( $project_id, $user_id, ); Sends a C request to C. =cut sub remove_project_member { my $self = shift; croak 'remove_project_member must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to remove_project_member must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to remove_project_member must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/members/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 ISSUE METHODS See L. =head2 global_issues my $issues = $api->global_issues( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub global_issues { my $self = shift; croak 'global_issues must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to global_issues must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('issues', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 group_issues my $issues = $api->group_issues( $group_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub group_issues { my $self = shift; croak 'group_issues must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to group_issues must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to group_issues must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('groups/%s/issues', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 issues my $issues = $api->issues( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub issues { my $self = shift; croak 'issues must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to issues must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to issues must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/issues', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 issue my $issue = $api->issue( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub issue { my $self = shift; croak 'issue must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to issue must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/issues/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_issue my $issue = $api->create_issue( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_issue { my $self = shift; croak 'create_issue must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_issue must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_issue must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/issues', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_issue my $issue = $api->edit_issue( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_issue { my $self = shift; croak 'edit_issue must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_issue must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to edit_issue must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_issue must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/issues/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 delete_issue $api->delete_issue( $project_id, $issue_iid, ); Sends a C request to C. =cut sub delete_issue { my $self = shift; croak 'delete_issue must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_issue must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to delete_issue must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/issues/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 move_issue my $issue = $api->move_issue( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub move_issue { my $self = shift; croak 'move_issue must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to move_issue must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to move_issue must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to move_issue must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/issues/%s/move', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 subscribe_to_issue my $issue = $api->subscribe_to_issue( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub subscribe_to_issue { my $self = shift; croak 'subscribe_to_issue must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to subscribe_to_issue must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to subscribe_to_issue must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/issues/%s/subscribe', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 unsubscribe_from_issue my $issue = $api->unsubscribe_from_issue( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub unsubscribe_from_issue { my $self = shift; croak 'unsubscribe_from_issue must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to unsubscribe_from_issue must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to unsubscribe_from_issue must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/issues/%s/unsubscribe', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 create_issue_todo my $todo = $api->create_issue_todo( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_issue_todo { my $self = shift; croak 'create_issue_todo must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to create_issue_todo must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to create_issue_todo must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/issues/%s/todo', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 set_issue_time_estimate my $tracking = $api->set_issue_time_estimate( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub set_issue_time_estimate { my $self = shift; croak 'set_issue_time_estimate must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to set_issue_time_estimate must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to set_issue_time_estimate must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to set_issue_time_estimate must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/issues/%s/time_estimate', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 reset_issue_time_estimate my $tracking = $api->reset_issue_time_estimate( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub reset_issue_time_estimate { my $self = shift; croak 'reset_issue_time_estimate must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to reset_issue_time_estimate must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to reset_issue_time_estimate must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/issues/%s/reset_time_estimate', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 add_issue_spent_time my $tracking = $api->add_issue_spent_time( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub add_issue_spent_time { my $self = shift; croak 'add_issue_spent_time must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to add_issue_spent_time must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to add_issue_spent_time must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to add_issue_spent_time must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/issues/%s/add_spent_time', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 reset_issue_spent_time my $tracking = $api->reset_issue_spent_time( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub reset_issue_spent_time { my $self = shift; croak 'reset_issue_spent_time must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to reset_issue_spent_time must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to reset_issue_spent_time must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/issues/%s/reset_spent_time', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 issue_time_stats my $tracking = $api->issue_time_stats( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub issue_time_stats { my $self = shift; croak 'issue_time_stats must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to issue_time_stats must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_time_stats must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/issues/%s/time_stats', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 issue_closed_by my $merge_requests = $api->issue_closed_by( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub issue_closed_by { my $self = shift; croak 'issue_closed_by must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to issue_closed_by must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_closed_by must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/issues/%s/closed_by', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 issue_user_agent_detail my $user_agent = $api->issue_user_agent_detail( $project_id, $issue_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub issue_user_agent_detail { my $self = shift; croak 'issue_user_agent_detail must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to issue_user_agent_detail must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_user_agent_detail must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/issues/%s/user_agent_detail', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head1 ISSUE BOARD METHODS See L. =head2 project_boards my $boards = $api->project_boards( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_boards { my $self = shift; croak 'project_boards must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to project_boards must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/boards', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 project_board_lists my $lists = $api->project_board_lists( $project_id, $board_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_board_lists { my $self = shift; croak 'project_board_lists must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_board_lists must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to project_board_lists must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/boards/%s/lists', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 project_board_list my $list = $api->project_board_list( $project_id, $board_id, $list_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_board_list { my $self = shift; croak 'project_board_list must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to project_board_list must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to project_board_list must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($list_id) to project_board_list must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/boards/%s/lists/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_project_board_list my $list = $api->create_project_board_list( $project_id, $board_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_project_board_list { my $self = shift; croak 'create_project_board_list must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_project_board_list must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to create_project_board_list must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_project_board_list must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/boards/%s/lists', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_project_board_list my $list = $api->edit_project_board_list( $project_id, $board_id, $list_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_project_board_list { my $self = shift; croak 'edit_project_board_list must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to edit_project_board_list must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to edit_project_board_list must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($list_id) to edit_project_board_list must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to edit_project_board_list must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $path = sprintf('projects/%s/boards/%s/lists/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 delete_project_board_list $api->delete_project_board_list( $project_id, $board_id, $list_id, ); Sends a C request to C. =cut sub delete_project_board_list { my $self = shift; croak 'delete_project_board_list must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_project_board_list must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($board_id) to delete_project_board_list must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($list_id) to delete_project_board_list must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/boards/%s/lists/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 JOB METHODS See L. =head2 jobs my $jobs = $api->jobs( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub jobs { my $self = shift; croak 'jobs must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to jobs must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to jobs must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/jobs', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 pipeline_jobs my $jobs = $api->pipeline_jobs( $project_id, $pipeline_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub pipeline_jobs { my $self = shift; croak 'pipeline_jobs must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to pipeline_jobs must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_id) to pipeline_jobs must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to pipeline_jobs must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/pipelines/%s/jobs', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 job my $job = $api->job( $project_id, $job_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub job { my $self = shift; croak 'job must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to job must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to job must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/jobs/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 job_artifacts my $artifacts = $api->job_artifacts( $project_id, $job_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub job_artifacts { my $self = shift; croak 'job_artifacts must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to job_artifacts must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to job_artifacts must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/jobs/%s/artifacts', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 job_artifacts_archive my $archive = $api->job_artifacts_archive( $project_id, $ref_name, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub job_artifacts_archive { my $self = shift; croak 'job_artifacts_archive must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to job_artifacts_archive must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($ref_name) to job_artifacts_archive must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to job_artifacts_archive must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/jobs/artifacts/%s/download', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 job_artifacts_file my $file = $api->job_artifacts_file( $project_id, $job_id, $artifact_path, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub job_artifacts_file { my $self = shift; croak 'job_artifacts_file must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to job_artifacts_file must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to job_artifacts_file must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($artifact_path) to job_artifacts_file must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/jobs/%s/artifacts/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 job_trace_file my $file = $api->job_trace_file( $project_id, $job_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub job_trace_file { my $self = shift; croak 'job_trace_file must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to job_trace_file must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to job_trace_file must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/jobs/%s/trace', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 cancel_job my $job = $api->cancel_job( $project_id, $job_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub cancel_job { my $self = shift; croak 'cancel_job must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to cancel_job must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to cancel_job must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/jobs/%s/cancel', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 retry_job my $job = $api->retry_job( $project_id, $job_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub retry_job { my $self = shift; croak 'retry_job must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to retry_job must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to retry_job must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/jobs/%s/retry', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 erase_job my $job = $api->erase_job( $project_id, $job_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub erase_job { my $self = shift; croak 'erase_job must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to erase_job must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to erase_job must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/jobs/%s/erase', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 keep_job_artifacts my $job = $api->keep_job_artifacts( $project_id, $job_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub keep_job_artifacts { my $self = shift; croak 'keep_job_artifacts must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to keep_job_artifacts must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to keep_job_artifacts must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/jobs/%s/artifacts/keep', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 play_job my $job = $api->play_job( $project_id, $job_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub play_job { my $self = shift; croak 'play_job must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to play_job must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($job_id) to play_job must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/jobs/%s/play', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head1 KEY METHODS See L. =head2 key my $key = $api->key( $key_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub key { my $self = shift; croak 'key must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($key_id) to key must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('keys/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head1 LABEL METHODS See L. =head2 labels my $labels = $api->labels( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub labels { my $self = shift; croak 'labels must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to labels must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/labels', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_label my $label = $api->create_label( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_label { my $self = shift; croak 'create_label must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_label must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_label must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/labels', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 delete_label $api->delete_label( $project_id, \%params, ); Sends a C request to C. =cut sub delete_label { my $self = shift; croak 'delete_label must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to delete_label must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to delete_label must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/labels', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path, ( defined($params) ? $params : () ) ); return; } =head2 edit_label my $label = $api->edit_label( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_label { my $self = shift; croak 'edit_label must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to edit_label must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to edit_label must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/labels', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 subscribe_to_label my $label = $api->subscribe_to_label( $project_id, $label_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub subscribe_to_label { my $self = shift; croak 'subscribe_to_label must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to subscribe_to_label must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($label_id) to subscribe_to_label must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/labels/%s/subscribe', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 unsubscribe_from_label $api->unsubscribe_from_label( $project_id, $label_id, ); Sends a C request to C. =cut sub unsubscribe_from_label { my $self = shift; croak 'unsubscribe_from_label must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to unsubscribe_from_label must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($label_id) to unsubscribe_from_label must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/labels/%s/unsubscribe', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path ); return; } =head1 MERGE REQUEST METHODS See L. =head2 global_merge_requests my $merge_requests = $api->global_merge_requests( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub global_merge_requests { my $self = shift; croak 'global_merge_requests must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to global_merge_requests must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('merge_requests', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 merge_requests my $merge_requests = $api->merge_requests( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub merge_requests { my $self = shift; croak 'merge_requests must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to merge_requests must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to merge_requests must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/merge_requests', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 merge_request my $merge_request = $api->merge_request( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub merge_request { my $self = shift; croak 'merge_request must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 merge_request_commits my $commits = $api->merge_request_commits( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub merge_request_commits { my $self = shift; croak 'merge_request_commits must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to merge_request_commits must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_commits must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s/commits', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 merge_request_with_changes my $merge_request = $api->merge_request_with_changes( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub merge_request_with_changes { my $self = shift; croak 'merge_request_with_changes must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to merge_request_with_changes must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_with_changes must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s/changes', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_merge_request my $merge_request = $api->create_merge_request( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_merge_request { my $self = shift; croak 'create_merge_request must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_merge_request must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/merge_requests', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_merge_request my $merge_request = $api->edit_merge_request( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_merge_request { my $self = shift; croak 'edit_merge_request must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to edit_merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_merge_request must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/merge_requests/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 delete_merge_request $api->delete_merge_request( $project_id, $merge_request_iid, ); Sends a C request to C. =cut sub delete_merge_request { my $self = shift; croak 'delete_merge_request must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to delete_merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 accept_merge_request my $merge_request = $api->accept_merge_request( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub accept_merge_request { my $self = shift; croak 'accept_merge_request must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to accept_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to accept_merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to accept_merge_request must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/merge_requests/%s/merge', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 cancel_merge_when_pipeline_succeeds my $merge_request = $api->cancel_merge_when_pipeline_succeeds( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub cancel_merge_when_pipeline_succeeds { my $self = shift; croak 'cancel_merge_when_pipeline_succeeds must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to cancel_merge_when_pipeline_succeeds must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to cancel_merge_when_pipeline_succeeds must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s/cancel_merge_when_pipeline_succeeds', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path ); } =head2 merge_request_closes_issues my $issues = $api->merge_request_closes_issues( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub merge_request_closes_issues { my $self = shift; croak 'merge_request_closes_issues must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to merge_request_closes_issues must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_closes_issues must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s/closes_issues', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 subscribe_to_merge_request my $merge_request = $api->subscribe_to_merge_request( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub subscribe_to_merge_request { my $self = shift; croak 'subscribe_to_merge_request must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to subscribe_to_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to subscribe_to_merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s/subscribe', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 unsubscribe_from_merge_request my $merge_request = $api->unsubscribe_from_merge_request( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub unsubscribe_from_merge_request { my $self = shift; croak 'unsubscribe_from_merge_request must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to unsubscribe_from_merge_request must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to unsubscribe_from_merge_request must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s/unsubscribe', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 create_merge_request_todo my $todo = $api->create_merge_request_todo( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_merge_request_todo { my $self = shift; croak 'create_merge_request_todo must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to create_merge_request_todo must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to create_merge_request_todo must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s/todo', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 merge_request_diff_versions my $versions = $api->merge_request_diff_versions( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub merge_request_diff_versions { my $self = shift; croak 'merge_request_diff_versions must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to merge_request_diff_versions must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_diff_versions must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s/versions', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 merge_request_diff_version my $version = $api->merge_request_diff_version( $project_id, $merge_request_iid, $version_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub merge_request_diff_version { my $self = shift; croak 'merge_request_diff_version must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to merge_request_diff_version must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_diff_version must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($version_id) to merge_request_diff_version must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/merge_requests/%s/versions/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 set_merge_request_time_estimate my $tracking = $api->set_merge_request_time_estimate( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub set_merge_request_time_estimate { my $self = shift; croak 'set_merge_request_time_estimate must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to set_merge_request_time_estimate must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to set_merge_request_time_estimate must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to set_merge_request_time_estimate must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/merge_requests/%s/time_estimate', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 reset_merge_request_time_estimate my $tracking = $api->reset_merge_request_time_estimate( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub reset_merge_request_time_estimate { my $self = shift; croak 'reset_merge_request_time_estimate must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to reset_merge_request_time_estimate must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to reset_merge_request_time_estimate must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s/reset_time_estimate', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 add_merge_request_spent_time my $tracking = $api->add_merge_request_spent_time( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub add_merge_request_spent_time { my $self = shift; croak 'add_merge_request_spent_time must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to add_merge_request_spent_time must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to add_merge_request_spent_time must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to add_merge_request_spent_time must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/merge_requests/%s/add_spent_time', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 reset_merge_request_spent_time my $tracking = $api->reset_merge_request_spent_time( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub reset_merge_request_spent_time { my $self = shift; croak 'reset_merge_request_spent_time must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to reset_merge_request_spent_time must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to reset_merge_request_spent_time must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s/reset_spent_time', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 merge_request_time_stats my $tracking = $api->merge_request_time_stats( $project_id, $merge_request_iid, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub merge_request_time_stats { my $self = shift; croak 'merge_request_time_stats must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to merge_request_time_stats must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_time_stats must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/merge_requests/%s/time_stats', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head1 PROJECT MILESTONE METHODS See L. =head2 project_milestones my $milestones = $api->project_milestones( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_milestones { my $self = shift; croak 'project_milestones must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project_milestones must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project_milestones must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/milestones', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 project_milestone my $milestone = $api->project_milestone( $project_id, $milestone_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_milestone { my $self = shift; croak 'project_milestone must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to project_milestone must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/milestones/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_project_milestone my $milestone = $api->create_project_milestone( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_project_milestone { my $self = shift; croak 'create_project_milestone must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_project_milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_project_milestone must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/milestones', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_project_milestone my $milestone = $api->edit_project_milestone( $project_id, $milestone_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_project_milestone { my $self = shift; croak 'edit_project_milestone must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_project_milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to edit_project_milestone must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_project_milestone must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/milestones/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 project_milestone_issues my $issues = $api->project_milestone_issues( $project_id, $milestone_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_milestone_issues { my $self = shift; croak 'project_milestone_issues must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_milestone_issues must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to project_milestone_issues must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/milestones/%s/issues', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 project_milestone_merge_requests my $merge_requests = $api->project_milestone_merge_requests( $project_id, $milestone_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_milestone_merge_requests { my $self = shift; croak 'project_milestone_merge_requests must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_milestone_merge_requests must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to project_milestone_merge_requests must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/milestones/%s/merge_requests', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head1 GROUP MILESTONE METHODS See L. =head2 group_milestones my $milestones = $api->group_milestones( $group_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub group_milestones { my $self = shift; croak 'group_milestones must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to group_milestones must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to group_milestones must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('groups/%s/milestones', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 group_milestone my $milestone = $api->group_milestone( $group_id, $milestone_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub group_milestone { my $self = shift; croak 'group_milestone must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to group_milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to group_milestone must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('groups/%s/milestones/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_group_milestone my $milestone = $api->create_group_milestone( $group_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_group_milestone { my $self = shift; croak 'create_group_milestone must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to create_group_milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_group_milestone must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('groups/%s/milestones', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_group_milestone my $milestone = $api->edit_group_milestone( $group_id, $milestone_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_group_milestone { my $self = shift; croak 'edit_group_milestone must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($group_id) to edit_group_milestone must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to edit_group_milestone must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_group_milestone must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('groups/%s/milestones/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 group_milestone_issues my $issues = $api->group_milestone_issues( $group_id, $milestone_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub group_milestone_issues { my $self = shift; croak 'group_milestone_issues must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to group_milestone_issues must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to group_milestone_issues must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('groups/%s/milestones/%s/issues', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 group_milestone_merge_requests my $merge_requests = $api->group_milestone_merge_requests( $group_id, $milestone_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub group_milestone_merge_requests { my $self = shift; croak 'group_milestone_merge_requests must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to group_milestone_merge_requests must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($milestone_id) to group_milestone_merge_requests must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('groups/%s/milestones/%s/merge_requests', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head1 NAMESPACE METHODS See L. =head2 namespaces my $namespaces = $api->namespaces( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub namespaces { my $self = shift; croak 'namespaces must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to namespaces must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('namespaces', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 namespace my $namespace = $api->namespace( $namespace_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub namespace { my $self = shift; croak 'namespace must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($namespace_id) to namespace must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('namespaces/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head1 NOTE METHODS See L. =head2 issue_notes my $notes = $api->issue_notes( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub issue_notes { my $self = shift; croak 'issue_notes must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to issue_notes must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_notes must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to issue_notes must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/issues/%s/notes', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 issue_note my $note = $api->issue_note( $project_id, $issue_iid, $note_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub issue_note { my $self = shift; croak 'issue_note must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to issue_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to issue_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to issue_note must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/issues/%s/notes/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_issue_note my $note = $api->create_issue_note( $project_id, $issue_iid, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_issue_note { my $self = shift; croak 'create_issue_note must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_issue_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to create_issue_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_issue_note must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/issues/%s/notes', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_issue_note $api->edit_issue_note( $project_id, $issue_iid, $note_id, \%params, ); Sends a C request to C. =cut sub edit_issue_note { my $self = shift; croak 'edit_issue_note must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to edit_issue_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to edit_issue_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to edit_issue_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to edit_issue_note must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $path = sprintf('projects/%s/issues/%s/notes/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); return; } =head2 delete_issue_note $api->delete_issue_note( $project_id, $issue_iid, $note_id, ); Sends a C request to C. =cut sub delete_issue_note { my $self = shift; croak 'delete_issue_note must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_issue_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($issue_iid) to delete_issue_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to delete_issue_note must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/issues/%s/notes/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 snippet_notes my $notes = $api->snippet_notes( $project_id, $snippet_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub snippet_notes { my $self = shift; croak 'snippet_notes must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to snippet_notes must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to snippet_notes must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to snippet_notes must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/snippets/%s/notes', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 snippet_note my $note = $api->snippet_note( $project_id, $snippet_id, $note_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub snippet_note { my $self = shift; croak 'snippet_note must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to snippet_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to snippet_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to snippet_note must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/snippets/%s/notes/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_snippet_note my $note = $api->create_snippet_note( $project_id, $snippet_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_snippet_note { my $self = shift; croak 'create_snippet_note must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_snippet_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to create_snippet_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_snippet_note must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/snippets/%s/notes', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_snippet_note $api->edit_snippet_note( $project_id, $snippet_id, $note_id, \%params, ); Sends a C request to C. =cut sub edit_snippet_note { my $self = shift; croak 'edit_snippet_note must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to edit_snippet_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to edit_snippet_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to edit_snippet_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to edit_snippet_note must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $path = sprintf('projects/%s/snippets/%s/notes/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); return; } =head2 delete_snippet_note $api->delete_snippet_note( $project_id, $snippet_id, $note_id, ); Sends a C request to C. =cut sub delete_snippet_note { my $self = shift; croak 'delete_snippet_note must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_snippet_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to delete_snippet_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to delete_snippet_note must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/snippets/%s/notes/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 merge_request_notes my $notes = $api->merge_request_notes( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub merge_request_notes { my $self = shift; croak 'merge_request_notes must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to merge_request_notes must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_notes must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to merge_request_notes must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/merge_requests/%s/notes', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 merge_request_note my $note = $api->merge_request_note( $project_id, $merge_request_iid, $note_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub merge_request_note { my $self = shift; croak 'merge_request_note must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to merge_request_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to merge_request_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to merge_request_note must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/merge_requests/%s/notes/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_merge_request_note my $note = $api->create_merge_request_note( $project_id, $merge_request_iid, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_merge_request_note { my $self = shift; croak 'create_merge_request_note must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_merge_request_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to create_merge_request_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_merge_request_note must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/merge_requests/%s/notes', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_merge_request_note $api->edit_merge_request_note( $project_id, $merge_request_iid, $note_id, \%params, ); Sends a C request to C. =cut sub edit_merge_request_note { my $self = shift; croak 'edit_merge_request_note must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to edit_merge_request_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to edit_merge_request_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to edit_merge_request_note must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to edit_merge_request_note must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $path = sprintf('projects/%s/merge_requests/%s/notes/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); return; } =head2 delete_merge_request_note $api->delete_merge_request_note( $project_id, $merge_request_iid, $note_id, ); Sends a C request to C. =cut sub delete_merge_request_note { my $self = shift; croak 'delete_merge_request_note must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_merge_request_note must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($merge_request_iid) to delete_merge_request_note must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($note_id) to delete_merge_request_note must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/merge_requests/%s/notes/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 NOTIFICATION SETTING METHODS See L. =head2 global_notification_settings my $settings = $api->global_notification_settings(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub global_notification_settings { my $self = shift; croak "The global_notification_settings method does not take any arguments" if @_; my $path = sprintf('notification_settings', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 set_global_notification_settings my $settings = $api->set_global_notification_settings( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub set_global_notification_settings { my $self = shift; croak 'set_global_notification_settings must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to set_global_notification_settings must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('notification_settings', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 group_notification_settings my $settings = $api->group_notification_settings( $group_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub group_notification_settings { my $self = shift; croak 'group_notification_settings must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to group_notification_settings must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('groups/%s/notification_settings', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 project_notification_settings my $settings = $api->project_notification_settings( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_notification_settings { my $self = shift; croak 'project_notification_settings must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to project_notification_settings must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/notification_settings', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 set_group_notification_settings my $settings = $api->set_group_notification_settings( $group_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub set_group_notification_settings { my $self = shift; croak 'set_group_notification_settings must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($group_id) to set_group_notification_settings must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to set_group_notification_settings must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('groups/%s/notification_settings', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 set_project_notification_settings my $settings = $api->set_project_notification_settings( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub set_project_notification_settings { my $self = shift; croak 'set_project_notification_settings must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to set_project_notification_settings must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to set_project_notification_settings must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/notification_settings', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head1 OPEN SOURCE LICENSE TEMPLATE METHODS See L. =head2 license_templates my $templates = $api->license_templates( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub license_templates { my $self = shift; croak 'license_templates must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to license_templates must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('templates/licenses', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 license_template my $template = $api->license_template( $template_key, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub license_template { my $self = shift; croak 'license_template must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($template_key) to license_template must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to license_template must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('templates/licenses/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head1 PAGE DOMAIN METHODS See L. =head2 global_pages_domains my $domains = $api->global_pages_domains(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub global_pages_domains { my $self = shift; croak "The global_pages_domains method does not take any arguments" if @_; my $path = sprintf('pages/domains', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 pages_domains my $domains = $api->pages_domains( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub pages_domains { my $self = shift; croak 'pages_domains must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to pages_domains must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/pages/domains', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 pages_domain my $domain = $api->pages_domain( $project_id, $domain, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub pages_domain { my $self = shift; croak 'pages_domain must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to pages_domain must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($domain) to pages_domain must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/pages/domains/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_pages_domain my $domain = $api->create_pages_domain( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_pages_domain { my $self = shift; croak 'create_pages_domain must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_pages_domain must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_pages_domain must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/pages/domains', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_pages_domain my $domain = $api->edit_pages_domain( $project_id, $domain, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_pages_domain { my $self = shift; croak 'edit_pages_domain must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_pages_domain must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($domain) to edit_pages_domain must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_pages_domain must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/pages/domains/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 delete_pages_domain $api->delete_pages_domain( $project_id, $domain, ); Sends a C request to C. =cut sub delete_pages_domain { my $self = shift; croak 'delete_pages_domain must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_pages_domain must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($domain) to delete_pages_domain must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/pages/domains/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 PIPELINE METHODS See L. =head2 pipelines my $pipelines = $api->pipelines( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub pipelines { my $self = shift; croak 'pipelines must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to pipelines must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to pipelines must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/pipelines', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 pipeline my $pipeline = $api->pipeline( $project_id, $pipeline_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub pipeline { my $self = shift; croak 'pipeline must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to pipeline must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_id) to pipeline must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/pipelines/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_pipeline my $pipeline = $api->create_pipeline( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_pipeline { my $self = shift; croak 'create_pipeline must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_pipeline must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_pipeline must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/pipeline', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 retry_pipeline_jobs my $pipeline = $api->retry_pipeline_jobs( $project_id, $pipeline_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub retry_pipeline_jobs { my $self = shift; croak 'retry_pipeline_jobs must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to retry_pipeline_jobs must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_id) to retry_pipeline_jobs must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/pipelines/%s/retry', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 cancel_pipeline_jobs my $pipeline = $api->cancel_pipeline_jobs( $project_id, $pipeline_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub cancel_pipeline_jobs { my $self = shift; croak 'cancel_pipeline_jobs must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to cancel_pipeline_jobs must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_id) to cancel_pipeline_jobs must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/pipelines/%s/cancel', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head1 PIPELINE TRIGGER METHODS See L. =head2 triggers my $triggers = $api->triggers( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub triggers { my $self = shift; croak 'triggers must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to triggers must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/triggers', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 trigger my $trigger = $api->trigger( $project_id, $trigger_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub trigger { my $self = shift; croak 'trigger must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to trigger must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($trigger_id) to trigger must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/triggers/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_trigger my $trigger = $api->create_trigger( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_trigger { my $self = shift; croak 'create_trigger must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_trigger must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_trigger must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/triggers', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_trigger my $trigger = $api->edit_trigger( $project_id, $trigger_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_trigger { my $self = shift; croak 'edit_trigger must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_trigger must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($trigger_id) to edit_trigger must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_trigger must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/triggers/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 take_ownership_of_trigger my $trigger = $api->take_ownership_of_trigger( $project_id, $trigger_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub take_ownership_of_trigger { my $self = shift; croak 'take_ownership_of_trigger must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to take_ownership_of_trigger must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($trigger_id) to take_ownership_of_trigger must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/triggers/%s/take_ownership', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 delete_trigger $api->delete_trigger( $project_id, $trigger_id, ); Sends a C request to C. =cut sub delete_trigger { my $self = shift; croak 'delete_trigger must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_trigger must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($trigger_id) to delete_trigger must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/triggers/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 PIPELINE SCHEDULE METHODS See L. =head2 pipeline_schedules my $schedules = $api->pipeline_schedules( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub pipeline_schedules { my $self = shift; croak 'pipeline_schedules must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to pipeline_schedules must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to pipeline_schedules must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/pipeline_schedules', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 pipeline_schedule my $schedule = $api->pipeline_schedule( $project_id, $pipeline_schedule_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub pipeline_schedule { my $self = shift; croak 'pipeline_schedule must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to pipeline_schedule must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_schedule_id) to pipeline_schedule must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/pipeline_schedules/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_pipeline_schedule my $schedule = $api->create_pipeline_schedule( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_pipeline_schedule { my $self = shift; croak 'create_pipeline_schedule must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_pipeline_schedule must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_pipeline_schedule must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/pipeline_schedules', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_pipeline_schedule my $schedule = $api->edit_pipeline_schedule( $project_id, $pipeline_schedule_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_pipeline_schedule { my $self = shift; croak 'edit_pipeline_schedule must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_pipeline_schedule must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_schedule_id) to edit_pipeline_schedule must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_pipeline_schedule must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/pipeline_schedules/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 take_ownership_of_pipeline_schedule my $schedule = $api->take_ownership_of_pipeline_schedule( $project_id, $pipeline_schedule_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub take_ownership_of_pipeline_schedule { my $self = shift; croak 'take_ownership_of_pipeline_schedule must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to take_ownership_of_pipeline_schedule must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_schedule_id) to take_ownership_of_pipeline_schedule must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/pipeline_schedules/%s/take_ownership', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 delete_pipeline_schedule my $schedule = $api->delete_pipeline_schedule( $project_id, $pipeline_schedule_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub delete_pipeline_schedule { my $self = shift; croak 'delete_pipeline_schedule must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_pipeline_schedule must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_schedule_id) to delete_pipeline_schedule must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/pipeline_schedules/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'delete', $path ); } =head2 create_pipeline_schedule_variable my $variable = $api->create_pipeline_schedule_variable( $project_id, $pipeline_schedule_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_pipeline_schedule_variable { my $self = shift; croak 'create_pipeline_schedule_variable must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_pipeline_schedule_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_schedule_id) to create_pipeline_schedule_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_pipeline_schedule_variable must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/pipeline_schedules/%s/variables', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_pipeline_schedule_variable my $variable = $api->edit_pipeline_schedule_variable( $project_id, $pipeline_schedule_id, $variable_key, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_pipeline_schedule_variable { my $self = shift; croak 'edit_pipeline_schedule_variable must be called with 3 to 4 arguments' if @_ < 3 or @_ > 4; croak 'The #1 argument ($project_id) to edit_pipeline_schedule_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_schedule_id) to edit_pipeline_schedule_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($variable_key) to edit_pipeline_schedule_variable must be a scalar' if ref($_[2]) or (!defined $_[2]); croak 'The last argument (\%params) to edit_pipeline_schedule_variable must be a hash ref' if defined($_[3]) and ref($_[3]) ne 'HASH'; my $params = (@_ == 4) ? pop() : undef; my $path = sprintf('projects/%s/pipeline_schedules/%s/variables/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 delete_pipeline_schedule_variable my $variable = $api->delete_pipeline_schedule_variable( $project_id, $pipeline_schedule_id, $variable_key, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub delete_pipeline_schedule_variable { my $self = shift; croak 'delete_pipeline_schedule_variable must be called with 3 arguments' if @_ != 3; croak 'The #1 argument ($project_id) to delete_pipeline_schedule_variable must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($pipeline_schedule_id) to delete_pipeline_schedule_variable must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The #3 argument ($variable_key) to delete_pipeline_schedule_variable must be a scalar' if ref($_[2]) or (!defined $_[2]); my $path = sprintf('projects/%s/pipeline_schedules/%s/variables/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'delete', $path ); } =head1 PROJECT METHODS See L. =head2 projects my $projects = $api->projects( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub projects { my $self = shift; croak 'projects must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to projects must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('projects', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 user_projects my $projects = $api->user_projects( $user_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub user_projects { my $self = shift; croak 'user_projects must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to user_projects must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to user_projects must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('users/%s/projects', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 project my $project = $api->project( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project { my $self = shift; croak 'project must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 project_users my $users = $api->project_users( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_users { my $self = shift; croak 'project_users must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to project_users must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/users', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_project my $project = $api->create_project( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_project { my $self = shift; croak 'create_project must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_project must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('projects', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 create_project_for_user $api->create_project_for_user( $user_id, \%params, ); Sends a C request to C. =cut sub create_project_for_user { my $self = shift; croak 'create_project_for_user must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to create_project_for_user must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_project_for_user must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/user/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 edit_project $api->edit_project( $project_id, \%params, ); Sends a C request to C. =cut sub edit_project { my $self = shift; croak 'edit_project must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to edit_project must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to edit_project must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); return; } =head2 fork_project $api->fork_project( $project_id, \%params, ); Sends a C request to C. =cut sub fork_project { my $self = shift; croak 'fork_project must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to fork_project must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to fork_project must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/fork', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 project_forks my $forks = $api->project_forks( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_forks { my $self = shift; croak 'project_forks must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to project_forks must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to project_forks must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/forks', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 start_project my $project = $api->start_project( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub start_project { my $self = shift; croak 'start_project must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to start_project must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/star', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 unstar_project my $project = $api->unstar_project( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub unstar_project { my $self = shift; croak 'unstar_project must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to unstar_project must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/unstar', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 archive_project my $project = $api->archive_project( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub archive_project { my $self = shift; croak 'archive_project must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to archive_project must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/archive', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 unarchive_project my $project = $api->unarchive_project( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub unarchive_project { my $self = shift; croak 'unarchive_project must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to unarchive_project must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/unarchive', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 delete_project $api->delete_project( $project_id, ); Sends a C request to C. =cut sub delete_project { my $self = shift; croak 'delete_project must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to delete_project must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 upload_file_to_project my $upload = $api->upload_file_to_project( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub upload_file_to_project { my $self = shift; croak 'upload_file_to_project must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to upload_file_to_project must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to upload_file_to_project must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/uploads', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 share_project_with_group $api->share_project_with_group( $project_id, \%params, ); Sends a C request to C. =cut sub share_project_with_group { my $self = shift; croak 'share_project_with_group must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to share_project_with_group must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to share_project_with_group must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/share', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 unshare_project_with_group $api->unshare_project_with_group( $project_id, $group_id, ); Sends a C request to C. =cut sub unshare_project_with_group { my $self = shift; croak 'unshare_project_with_group must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to unshare_project_with_group must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($group_id) to unshare_project_with_group must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/share/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 project_hooks my $hooks = $api->project_hooks( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_hooks { my $self = shift; croak 'project_hooks must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to project_hooks must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/hooks', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 project_hook my $hook = $api->project_hook( $project_id, $hook_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_hook { my $self = shift; croak 'project_hook must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to project_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($hook_id) to project_hook must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('project/%s/hooks/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_project_hook $api->create_project_hook( $project_id, \%params, ); Sends a C request to C. =cut sub create_project_hook { my $self = shift; croak 'create_project_hook must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_project_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_project_hook must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/hooks', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 edit_project_hook $api->edit_project_hook( $project_id, $hook_id, \%params, ); Sends a C request to C. =cut sub edit_project_hook { my $self = shift; croak 'edit_project_hook must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_project_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($hook_id) to edit_project_hook must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_project_hook must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/hooks/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); return; } =head2 delete_project_hook my $hook = $api->delete_project_hook( $project_id, $hook_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub delete_project_hook { my $self = shift; croak 'delete_project_hook must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_project_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($hook_id) to delete_project_hook must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/hooks/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'delete', $path ); } =head2 set_project_fork $api->set_project_fork( $project_id, $from_project_id, ); Sends a C request to C. =cut sub set_project_fork { my $self = shift; croak 'set_project_fork must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to set_project_fork must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($from_project_id) to set_project_fork must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/fork/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path ); return; } =head2 clear_project_fork $api->clear_project_fork( $project_id, ); Sends a C request to C. =cut sub clear_project_fork { my $self = shift; croak 'clear_project_fork must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to clear_project_fork must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/fork', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 start_housekeeping $api->start_housekeeping( $project_id, ); Sends a C request to C. =cut sub start_housekeeping { my $self = shift; croak 'start_housekeeping must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to start_housekeeping must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/housekeeping', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path ); return; } =head1 PROJECT ACCESS REQUEST METHODS See L. =head2 group_access_requests my $requests = $api->group_access_requests( $group_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub group_access_requests { my $self = shift; croak 'group_access_requests must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to group_access_requests must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('groups/%s/access_requests', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 project_access_requests my $requests = $api->project_access_requests( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_access_requests { my $self = shift; croak 'project_access_requests must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to project_access_requests must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/access_requests', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 request_group_access my $request = $api->request_group_access( $group_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub request_group_access { my $self = shift; croak 'request_group_access must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($group_id) to request_group_access must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('groups/%s/access_requests', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 request_project_access my $request = $api->request_project_access( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub request_project_access { my $self = shift; croak 'request_project_access must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to request_project_access must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/access_requests', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path ); } =head2 approve_group_access my $request = $api->approve_group_access( $group_id, $user_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub approve_group_access { my $self = shift; croak 'approve_group_access must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to approve_group_access must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to approve_group_access must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('groups/%s/access_requests/%s/approve', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path ); } =head2 approve_project_access my $request = $api->approve_project_access( $project_id, $user_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub approve_project_access { my $self = shift; croak 'approve_project_access must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to approve_project_access must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to approve_project_access must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/access_requests/%s/approve', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path ); } =head2 deny_group_access $api->deny_group_access( $group_id, $user_id, ); Sends a C request to C. =cut sub deny_group_access { my $self = shift; croak 'deny_group_access must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($group_id) to deny_group_access must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to deny_group_access must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('groups/%s/access_requests/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 deny_project_access $api->deny_project_access( $project_id, $user_id, ); Sends a C request to C. =cut sub deny_project_access { my $self = shift; croak 'deny_project_access must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to deny_project_access must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($user_id) to deny_project_access must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/access_requests/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 PROJECT SNIPPET METHODS See L. =head2 snippets my $snippets = $api->snippets( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub snippets { my $self = shift; croak 'snippets must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to snippets must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/snippets', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 snippet my $snippet = $api->snippet( $project_id, $snippet_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub snippet { my $self = shift; croak 'snippet must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to snippet must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/snippets/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_snippet $api->create_snippet( $project_id, \%params, ); Sends a C request to C. =cut sub create_snippet { my $self = shift; croak 'create_snippet must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_snippet must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/snippets', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 edit_snippet $api->edit_snippet( $project_id, $snippet_id, \%params, ); Sends a C request to C. =cut sub edit_snippet { my $self = shift; croak 'edit_snippet must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to edit_snippet must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_snippet must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/snippets/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); return; } =head2 delete_snippet $api->delete_snippet( $project_id, $snippet_id, ); Sends a C request to C. =cut sub delete_snippet { my $self = shift; croak 'delete_snippet must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_snippet must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to delete_snippet must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/snippets/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 snippet_content my $content = $api->snippet_content( $project_id, $snippet_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub snippet_content { my $self = shift; croak 'snippet_content must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to snippet_content must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to snippet_content must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/snippets/%s/raw', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 snippet_user_agent_detail my $user_agent = $api->snippet_user_agent_detail( $project_id, $snippet_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub snippet_user_agent_detail { my $self = shift; croak 'snippet_user_agent_detail must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to snippet_user_agent_detail must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($snippet_id) to snippet_user_agent_detail must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/snippets/%s/user_agent_detail', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head1 PROTECTED BRANCH METHODS See L. =head2 protected_branches my $branches = $api->protected_branches( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub protected_branches { my $self = shift; croak 'protected_branches must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to protected_branches must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/protected_branches', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 protected_branch my $branch = $api->protected_branch( $project_id, $branch_name, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub protected_branch { my $self = shift; croak 'protected_branch must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to protected_branch must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($branch_name) to protected_branch must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/protected_branches/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 protect_branch my $branch = $api->protect_branch( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub protect_branch { my $self = shift; croak 'protect_branch must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to protect_branch must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to protect_branch must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/protected_branches', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 unprotect_branch $api->unprotect_branch( $project_id, $branch_name, ); Sends a C request to C. =cut sub unprotect_branch { my $self = shift; croak 'unprotect_branch must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to unprotect_branch must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($branch_name) to unprotect_branch must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/protected_branches/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 REPOSITORY METHODS See L. =head2 tree my $tree = $api->tree( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub tree { my $self = shift; croak 'tree must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to tree must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to tree must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/repository/tree', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 blob my $blob = $api->blob( $project_id, $sha, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub blob { my $self = shift; croak 'blob must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to blob must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($sha) to blob must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/repository/blobs/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 raw_blob my $raw_blob = $api->raw_blob( $project_id, $sha, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub raw_blob { my $self = shift; croak 'raw_blob must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to raw_blob must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($sha) to raw_blob must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/repository/blobs/%s/raw', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 archive my $archive = $api->archive( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub archive { my $self = shift; croak 'archive must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to archive must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to archive must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/repository/archive', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 compare my $comparison = $api->compare( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub compare { my $self = shift; croak 'compare must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to compare must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to compare must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/repository/compare', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 contributors my $contributors = $api->contributors( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub contributors { my $self = shift; croak 'contributors must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to contributors must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/repository/contributors', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head1 FILE METHODS See L. =head2 file my $file = $api->file( $project_id, $file_path, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub file { my $self = shift; croak 'file must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to file must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($file_path) to file must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to file must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/repository/files/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 raw_file my $file = $api->raw_file( $project_id, $file_path, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub raw_file { my $self = shift; croak 'raw_file must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to raw_file must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($file_path) to raw_file must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to raw_file must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/repository/files/%s/raw', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 create_file $api->create_file( $project_id, $file_path, \%params, ); Sends a C request to C. =cut sub create_file { my $self = shift; croak 'create_file must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_file must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($file_path) to create_file must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_file must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/repository/files/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 edit_file $api->edit_file( $project_id, $file_path, \%params, ); Sends a C request to C. =cut sub edit_file { my $self = shift; croak 'edit_file must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_file must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($file_path) to edit_file must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_file must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/repository/files/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); return; } =head2 delete_file $api->delete_file( $project_id, $file_path, \%params, ); Sends a C request to C. =cut sub delete_file { my $self = shift; croak 'delete_file must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to delete_file must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($file_path) to delete_file must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to delete_file must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/repository/files/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path, ( defined($params) ? $params : () ) ); return; } =head1 RUNNER METHODS See L. =head2 runners my $runners = $api->runners( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub runners { my $self = shift; croak 'runners must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to runners must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('runners', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 all_runners my $runners = $api->all_runners( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub all_runners { my $self = shift; croak 'all_runners must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to all_runners must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('runners/all', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 runner my $runner = $api->runner( $runner_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub runner { my $self = shift; croak 'runner must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($runner_id) to runner must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('runners/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 update_runner my $runner = $api->update_runner( $runner_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub update_runner { my $self = shift; croak 'update_runner must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($runner_id) to update_runner must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to update_runner must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('runners/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 delete_runner my $runner = $api->delete_runner( $runner_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub delete_runner { my $self = shift; croak 'delete_runner must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($runner_id) to delete_runner must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('runners/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'delete', $path ); } =head2 runner_jobs my $jobs = $api->runner_jobs( $runner_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub runner_jobs { my $self = shift; croak 'runner_jobs must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($runner_id) to runner_jobs must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to runner_jobs must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('runners/%s/jobs', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 project_runners my $runners = $api->project_runners( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub project_runners { my $self = shift; croak 'project_runners must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to project_runners must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/runners', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 enable_project_runner my $runner = $api->enable_project_runner( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub enable_project_runner { my $self = shift; croak 'enable_project_runner must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to enable_project_runner must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to enable_project_runner must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/runners', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 disable_project_runner my $runner = $api->disable_project_runner( $project_id, $runner_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub disable_project_runner { my $self = shift; croak 'disable_project_runner must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to disable_project_runner must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($runner_id) to disable_project_runner must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/runners/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'delete', $path ); } =head1 SERVICE METHODS See L. =head2 edit_project_service $api->edit_project_service( $project_id, $service_name, \%params, ); Sends a C request to C. =cut sub edit_project_service { my $self = shift; croak 'edit_project_service must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_project_service must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($service_name) to edit_project_service must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_project_service must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/services/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); return; } =head2 delete_project_service $api->delete_project_service( $project_id, $service_name, ); Sends a C request to C. =cut sub delete_project_service { my $self = shift; croak 'delete_project_service must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_project_service must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($service_name) to delete_project_service must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/services/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 SETTINGS METHODS See L. =head2 settings my $settings = $api->settings(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub settings { my $self = shift; croak "The settings method does not take any arguments" if @_; my $path = sprintf('application/settings', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 update_settings my $settings = $api->update_settings( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub update_settings { my $self = shift; croak 'update_settings must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to update_settings must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('application/settings', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head1 SIDEKIQ METRIC METHODS See L. =head2 queue_metrics my $metrics = $api->queue_metrics(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub queue_metrics { my $self = shift; croak "The queue_metrics method does not take any arguments" if @_; my $path = sprintf('sidekiq/queue_metrics', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 process_metrics my $metrics = $api->process_metrics(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub process_metrics { my $self = shift; croak "The process_metrics method does not take any arguments" if @_; my $path = sprintf('sidekiq/process_metrics', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 job_stats my $stats = $api->job_stats(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub job_stats { my $self = shift; croak "The job_stats method does not take any arguments" if @_; my $path = sprintf('sidekiq/job_stats', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 compound_metrics my $metrics = $api->compound_metrics(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub compound_metrics { my $self = shift; croak "The compound_metrics method does not take any arguments" if @_; my $path = sprintf('sidekiq/compound_metrics', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head1 SYSTEM HOOK METHODS See L. =head2 hooks my $hooks = $api->hooks(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub hooks { my $self = shift; croak "The hooks method does not take any arguments" if @_; my $path = sprintf('hooks', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_hook $api->create_hook( \%params, ); Sends a C request to C. =cut sub create_hook { my $self = shift; croak 'create_hook must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_hook must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('hooks', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 test_hook my $hook = $api->test_hook( $hook_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub test_hook { my $self = shift; croak 'test_hook must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($hook_id) to test_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('hooks/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 delete_hook $api->delete_hook( $hook_id, ); Sends a C request to C. =cut sub delete_hook { my $self = shift; croak 'delete_hook must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($hook_id) to delete_hook must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('hooks/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head1 TAG METHODS See L. =head2 tags my $tags = $api->tags( $project_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub tags { my $self = shift; croak 'tags must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($project_id) to tags must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('projects/%s/repository/tags', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 tag my $tag = $api->tag( $project_id, $tag_name, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub tag { my $self = shift; croak 'tag must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to tag must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to tag must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/repository/tags/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_tag my $tag = $api->create_tag( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_tag { my $self = shift; croak 'create_tag must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_tag must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_tag must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/repository/tags', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 delete_tag $api->delete_tag( $project_id, $tag_name, ); Sends a C request to C. =cut sub delete_tag { my $self = shift; croak 'delete_tag must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_tag must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to delete_tag must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/repository/tags/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 create_release $api->create_release( $project_id, $tag_name, \%params, ); Sends a C request to C. =cut sub create_release { my $self = shift; croak 'create_release must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to create_release must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to create_release must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to create_release must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/repository/tags/%s/release', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 edit_release $api->edit_release( $project_id, $tag_name, \%params, ); Sends a C request to C. =cut sub edit_release { my $self = shift; croak 'edit_release must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_release must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($tag_name) to edit_release must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_release must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/repository/tags/%s/release', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); return; } =head1 TODO METHODS See L. =head1 USER METHODS See L. =head2 users my $users = $api->users( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub users { my $self = shift; croak 'users must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to users must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('users', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 user my $user = $api->user( $user_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub user { my $self = shift; croak 'user must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($user_id) to user must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('users/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_user $api->create_user( \%params, ); Sends a C request to C. =cut sub create_user { my $self = shift; croak 'create_user must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_user must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('users', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 edit_user $api->edit_user( $user_id, \%params, ); Sends a C request to C. =cut sub edit_user { my $self = shift; croak 'edit_user must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to edit_user must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to edit_user must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('users/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); return; } =head2 delete_user my $user = $api->delete_user( $user_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub delete_user { my $self = shift; croak 'delete_user must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($user_id) to delete_user must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('users/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'delete', $path ); } =head2 current_user my $user = $api->current_user(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub current_user { my $self = shift; croak "The current_user method does not take any arguments" if @_; my $path = sprintf('user', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 current_user_ssh_keys my $keys = $api->current_user_ssh_keys(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub current_user_ssh_keys { my $self = shift; croak "The current_user_ssh_keys method does not take any arguments" if @_; my $path = sprintf('user/keys', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 user_ssh_keys my $keys = $api->user_ssh_keys( $user_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub user_ssh_keys { my $self = shift; croak 'user_ssh_keys must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($user_id) to user_ssh_keys must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('users/%s/keys', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 user_ssh_key my $key = $api->user_ssh_key( $key_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub user_ssh_key { my $self = shift; croak 'user_ssh_key must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($key_id) to user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('user/keys/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_current_user_ssh_key $api->create_current_user_ssh_key( \%params, ); Sends a C request to C. =cut sub create_current_user_ssh_key { my $self = shift; croak 'create_current_user_ssh_key must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_current_user_ssh_key must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('user/keys', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 create_user_ssh_key $api->create_user_ssh_key( $user_id, \%params, ); Sends a C request to C. =cut sub create_user_ssh_key { my $self = shift; croak 'create_user_ssh_key must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to create_user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_user_ssh_key must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('users/%s/keys', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 delete_current_user_ssh_key $api->delete_current_user_ssh_key( $key_id, ); Sends a C request to C. =cut sub delete_current_user_ssh_key { my $self = shift; croak 'delete_current_user_ssh_key must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($key_id) to delete_current_user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('user/keys/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 delete_user_ssh_key $api->delete_user_ssh_key( $user_id, $key_id, ); Sends a C request to C. =cut sub delete_user_ssh_key { my $self = shift; croak 'delete_user_ssh_key must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to delete_user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($key_id) to delete_user_ssh_key must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('users/%s/keys/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 current_user_gpg_keys my $keys = $api->current_user_gpg_keys(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub current_user_gpg_keys { my $self = shift; croak "The current_user_gpg_keys method does not take any arguments" if @_; my $path = sprintf('user/gpg_keys', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 current_user_gpg_key my $key = $api->current_user_gpg_key( $key_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub current_user_gpg_key { my $self = shift; croak 'current_user_gpg_key must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($key_id) to current_user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('user/gpg_keys/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_current_user_gpg_key $api->create_current_user_gpg_key( \%params, ); Sends a C request to C. =cut sub create_current_user_gpg_key { my $self = shift; croak 'create_current_user_gpg_key must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_current_user_gpg_key must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('user/gpg_keys', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); return; } =head2 delete_current_user_gpg_key $api->delete_current_user_gpg_key( $key_id, ); Sends a C request to C. =cut sub delete_current_user_gpg_key { my $self = shift; croak 'delete_current_user_gpg_key must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($key_id) to delete_current_user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('user/gpg_keys/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 user_gpg_keys my $keys = $api->user_gpg_keys( $user_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub user_gpg_keys { my $self = shift; croak 'user_gpg_keys must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($user_id) to user_gpg_keys must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('users/%s/gpg_keys', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 user_gpg_key my $key = $api->user_gpg_key( $user_id, $key_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub user_gpg_key { my $self = shift; croak 'user_gpg_key must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($key_id) to user_gpg_key must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('users/%s/gpg_keys/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_user_gpg_key my $keys = $api->create_user_gpg_key( $user_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_user_gpg_key { my $self = shift; croak 'create_user_gpg_key must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to create_user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_user_gpg_key must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('users/%s/gpg_keys', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 delete_user_gpg_key $api->delete_user_gpg_key( $user_id, $key_id, ); Sends a C request to C. =cut sub delete_user_gpg_key { my $self = shift; croak 'delete_user_gpg_key must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to delete_user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($key_id) to delete_user_gpg_key must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('users/%s/gpg_keys/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 current_user_emails my $emails = $api->current_user_emails(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub current_user_emails { my $self = shift; croak "The current_user_emails method does not take any arguments" if @_; my $path = sprintf('user/emails', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 user_emails my $emails = $api->user_emails( $user_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub user_emails { my $self = shift; croak 'user_emails must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($user_id) to user_emails must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('users/%s/emails', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 current_user_email my $email = $api->current_user_email( $email_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub current_user_email { my $self = shift; croak 'current_user_email must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($email_id) to current_user_email must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('user/emails/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_current_user_email my $email = $api->create_current_user_email( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_current_user_email { my $self = shift; croak 'create_current_user_email must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to create_current_user_email must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('user/emails', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 create_user_email my $email = $api->create_user_email( $user_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_user_email { my $self = shift; croak 'create_user_email must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to create_user_email must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_user_email must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('users/%s/emails', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 delete_current_user_email $api->delete_current_user_email( $email_id, ); Sends a C request to C. =cut sub delete_current_user_email { my $self = shift; croak 'delete_current_user_email must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($email_id) to delete_current_user_email must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('user/emails/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 delete_user_email $api->delete_user_email( $user_id, $email_id, ); Sends a C request to C. =cut sub delete_user_email { my $self = shift; croak 'delete_user_email must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to delete_user_email must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($email_id) to delete_user_email must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('users/%s/emails/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 block_user $api->block_user( $user_id, ); Sends a C request to C. =cut sub block_user { my $self = shift; croak 'block_user must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($user_id) to block_user must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('users/%s/block', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path ); return; } =head2 unblock_user $api->unblock_user( $user_id, ); Sends a C request to C. =cut sub unblock_user { my $self = shift; croak 'unblock_user must be called with 1 arguments' if @_ != 1; croak 'The #1 argument ($user_id) to unblock_user must be a scalar' if ref($_[0]) or (!defined $_[0]); my $path = sprintf('users/%s/unblock', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'post', $path ); return; } =head2 user_impersonation_tokens my $tokens = $api->user_impersonation_tokens( $user_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub user_impersonation_tokens { my $self = shift; croak 'user_impersonation_tokens must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to user_impersonation_tokens must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to user_impersonation_tokens must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('users/%s/impersonation_tokens', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 user_impersonation_token my $token = $api->user_impersonation_token( $user_id, $impersonation_token_id, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub user_impersonation_token { my $self = shift; croak 'user_impersonation_token must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to user_impersonation_token must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($impersonation_token_id) to user_impersonation_token must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('users/%s/impersonation_tokens/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_user_impersonation_token my $token = $api->create_user_impersonation_token( $user_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_user_impersonation_token { my $self = shift; croak 'create_user_impersonation_token must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($user_id) to create_user_impersonation_token must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_user_impersonation_token must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('users/%s/impersonation_tokens', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 delete_user_impersonation_token $api->delete_user_impersonation_token( $user_id, $impersonation_token_id, ); Sends a C request to C. =cut sub delete_user_impersonation_token { my $self = shift; croak 'delete_user_impersonation_token must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($user_id) to delete_user_impersonation_token must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($impersonation_token_id) to delete_user_impersonation_token must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('users/%s/impersonation_tokens/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } =head2 all_user_activities my $activities = $api->all_user_activities(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub all_user_activities { my $self = shift; croak "The all_user_activities method does not take any arguments" if @_; my $path = sprintf('user/activities', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head1 VALIDATE CI CONFIGURATION METHODS See L. =head2 lint my $result = $api->lint( \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub lint { my $self = shift; croak 'lint must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1; croak 'The last argument (\%params) to lint must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH'; my $params = (@_ == 1) ? pop() : undef; my $path = sprintf('lint', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head1 VERSION METHODS See L. =head2 version my $version = $api->version(); Sends a C request to C and returns the decoded/deserialized response body. =cut sub version { my $self = shift; croak "The version method does not take any arguments" if @_; my $path = sprintf('version', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head1 WIKI METHODS See L. =head2 wiki_pages my $pages = $api->wiki_pages( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub wiki_pages { my $self = shift; croak 'wiki_pages must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to wiki_pages must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to wiki_pages must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/wikis', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path, ( defined($params) ? $params : () ) ); } =head2 wiki_page my $pages = $api->wiki_page( $project_id, $slug, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub wiki_page { my $self = shift; croak 'wiki_page must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to wiki_page must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($slug) to wiki_page must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/wikis/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'get', $path ); } =head2 create_wiki_page my $page = $api->create_wiki_page( $project_id, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub create_wiki_page { my $self = shift; croak 'create_wiki_page must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2; croak 'The #1 argument ($project_id) to create_wiki_page must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The last argument (\%params) to create_wiki_page must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH'; my $params = (@_ == 2) ? pop() : undef; my $path = sprintf('projects/%s/wikis', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'post', $path, ( defined($params) ? $params : () ) ); } =head2 edit_wiki_page my $page = $api->edit_wiki_page( $project_id, $slug, \%params, ); Sends a C request to C and returns the decoded/deserialized response body. =cut sub edit_wiki_page { my $self = shift; croak 'edit_wiki_page must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3; croak 'The #1 argument ($project_id) to edit_wiki_page must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($slug) to edit_wiki_page must be a scalar' if ref($_[1]) or (!defined $_[1]); croak 'The last argument (\%params) to edit_wiki_page must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH'; my $params = (@_ == 3) ? pop() : undef; my $path = sprintf('projects/%s/wikis/%s', (map { uri_escape($_) } @_)); return $self->_call_rest_method( 'put', $path, ( defined($params) ? $params : () ) ); } =head2 delete_wiki_page $api->delete_wiki_page( $project_id, $slug, ); Sends a C request to C. =cut sub delete_wiki_page { my $self = shift; croak 'delete_wiki_page must be called with 2 arguments' if @_ != 2; croak 'The #1 argument ($project_id) to delete_wiki_page must be a scalar' if ref($_[0]) or (!defined $_[0]); croak 'The #2 argument ($slug) to delete_wiki_page must be a scalar' if ref($_[1]) or (!defined $_[1]); my $path = sprintf('projects/%s/wikis/%s', (map { uri_escape($_) } @_)); $self->_call_rest_method( 'delete', $path ); return; } sub raw_snippet { my $self = shift; warn "The raw_snippet method is deprecated, please use the snippet_content method instead"; return $self->snippet_content( @_ ); } 1; __END__ =head1 SEE ALSO L purports to provide an interface to the GitLab API, but it is hard to tell due to a complete lack of documentation via either POD or unit tests. =head1 CONTRIBUTING This module is auto-generated from a set of YAML files defining the interface of GitLab's API. If you'd like to contribute to this module then please feel free to make a L and submit a pull request, just make sure you edit the files in the C directory instead of C directly. Please see L for more information. Alternatively, you can L. =head1 AUTHOR Aran Clary Deltac gmail.com> =head2 CONTRIBUTORS =over =item * Dotan Dimet corky.net> =item * Nigel Gregoire gmail.com> =item * trunov-ms gmail.com> =item * Marek R. Sotola nasa.gov> =item * José Joaquín Atria gmail.com> =item * Dave Webb d5ve.com> =back =head1 ACKNOWLEDGEMENTS Thanks to L for encouraging their employees to contribute back to the open source ecosystem. Without their dedication to quality software development this distribution would not exist. =head1 LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. 00-report-prereqs.t100644000765000024 1273113235441140 16703 0ustar00aranstaff000000000000GitLab-API-v4-0.04/t#!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.024 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do 't/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; if ( $source && $HAS_CPAN_META ) { if ( my $meta = eval { CPAN::Meta->load_file($source) } ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } } else { $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( @dep_errors ) { diag join("\n", "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n", "The following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=4 sts=4 sw=4 et: 00-report-prereqs.dd100644000765000024 462513235441140 17012 0ustar00aranstaff000000000000GitLab-API-v4-0.04/tdo { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0' } }, 'develop' => { 'requires' => { 'Test::Pod' => '1.41' } }, 'runtime' => { 'requires' => { 'Carp' => '0', 'Const::Fast' => '0.014', 'Data::Dumper' => '0', 'Exporter' => '0', 'Getopt::Long' => '0', 'IO::Prompter' => '0.004014', 'JSON' => '2.92', 'Log::Any' => '1.703', 'Log::Any::Adapter' => '1.703', 'Log::Any::Adapter::Screen' => '0.13', 'Moo' => '2.003000', 'Path::Tiny' => '0.079', 'Pod::Usage' => '0', 'Role::REST::Client' => '0.22', 'Try::Tiny' => '0.28', 'Types::Common::Numeric' => '1.002001', 'Types::Common::String' => '1.002001', 'Types::Standard' => '1.002001', 'URI::Escape' => '1.72', 'namespace::clean' => '0.27', 'strictures' => '2.000003' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'Log::Any::Adapter::TAP' => '0.003003', 'Test2::V0' => '0.000094', 'Test::More' => '0' } } }; $x; }v4000755000765000024 013235441140 15532 5ustar00aranstaff000000000000GitLab-API-v4-0.04/lib/GitLab/APIConfig.pm100644000765000024 1337513235441140 17466 0ustar00aranstaff000000000000GitLab-API-v4-0.04/lib/GitLab/API/v4package GitLab::API::v4::Config; $GitLab::API::v4::Config::VERSION = '0.04'; =head1 NAME GitLab::API::v4::Config - Load configuration from a file, environment, and/or CLI options. =head1 SYNOPSIS use GitLab::API::v4; use GitLab::API::v4::Config; my $config = GitLab::API::v4::Config->new(); my $api = GitLab::API::v4->new( $config->args() ); =head1 DESCRIPTION This module is used by L to load configuration. If you are using L directly then this module will not be automaticaly used, but you are welcome to explicitly use it as shown in the L. =cut use Types::Standard -types; use Types::Common::String -types; use Path::Tiny; use JSON; use Log::Any qw( $log ); use Getopt::Long; use IO::Prompter; use Moo; use strictures 2; use namespace::clean; sub BUILD { my ($self) = @_; $self->opt_args(); return; } =head1 ARGUMENTS =head2 file The file to load configuration from. The file should hold valid JSON. By default this will be set to C<.gitlab-api-v4-config> in the current user's home directory. This can be overridden with the C environment variable or the C<--config-file=...> command line argument. =cut has file => ( is => 'lazy', isa => NonEmptySimpleStr, ); sub _build_file { my ($self) = @_; my $file = $self->opt_args->{config_file} || $self->env_args->{config_file}; return $file if $file; my ($home) = ( getpwuid($<) )[7]; return '' . path( $home )->child('.gitlab-api-v4-config'); } =head1 ATTRIBUTES =head2 opt_args Returns a hashref of arguments derived from command line options. Supported options are: --config_file=... --url=... --private-token=... --access-token=... --retries=... Note that the options are read from, and removed from, C<@ARGV>. Due to this the arguments are saved internally and re-used for all instances of this class so that there are no weird race conditions. =cut has opt_args => ( is => 'lazy', isa => HashRef, ); my $opt_args; sub _build_opt_args { my ($self) = @_; return $opt_args if $opt_args; Getopt::Long::Configure('pass_through'); GetOptions( 'config-file=s' => \my $config_file, 'url=s' => \my $url, 'private-token=s' => \my $private_token, 'access-token=s' => \my $access_token, 'retries=i' => \my $retries, ) or die('Unable to process options!'); $opt_args = $self->_filter_args({ config_file => $config_file, url => $url, private_token => $private_token, access_token => $access_token, retries => $retries, }); return $opt_args; } =head2 env_args Returns a hashref of arguments derived from environment variables. Supported environment variables are: GITLAB_API_V4_CONFIG_FILE GITLAB_API_V4_URL GITLAB_API_V4_PRIVATE_TOKEN GITLAB_API_V4_ACCESS_TOKEN GITLAB_API_V4_RETRIES =cut has env_args => ( is => 'lazy', isa => HashRef, ); sub _build_env_args { my ($self) = @_; return $self->_filter_args({ config_file => $ENV{GITLAB_API_V4_CONFIG_FILE}, url => $ENV{GITLAB_API_V4_URL}, private_token => $ENV{GITLAB_API_V4_PRIVATE_TOKEN}, access_token => $ENV{GITLAB_API_V4_ACCESS_TOKEN}, retries => $ENV{GITLAB_API_V4_RETRIES}, }); } =head2 file_args Returns a hashref of arguments gotten by decoding the JSON in the L. Note that the file is re-read every time you call this attribute (or the L attribute). =cut sub file_args { my ($self) = @_; my $file = $self->file(); return {} if !-r $file; $file = path( $file ); $log->debugf( 'Loading configuration for GitLab::API::v4 from: %s', $file->absolute() ); my $json = $file->slurp(); my $data = decode_json( $json ); return $self->_filter_args( $data ); } sub _filter_args { my ($self, $args) = @_; return { map { $_ => $args->{$_} } grep { $args->{$_} } keys %$args }; } =head2 args Returns a final, combined, hashref of arguments containing everything in L, L, and L. If there are any duplicate arguments then L has highest precedence, L is next, and at the bottom is L. =cut sub args { my ($self) = @_; return { %{ $self->file_args() }, %{ $self->env_args() }, %{ $self->opt_args() }, }; } =head1 METHODS =head2 configure When called this method interactively prompts the user for argument values and then encodes them as JSON and stores them in L. The file will be chmod'ed C<0600> so that only the current user may read or write to the file. =cut sub configure { my ($self) = @_; my $url = prompt( 'Full URL to a v4 GitLab API:', '-stdio', '-verbatim', ); my $private_token = prompt( 'Private Token:', -echo=>'', '-stdio', '-verbatim', ); my $access_token = prompt( 'Access Token:', -echo=>'', '-stdio', '-verbatim', ); my $json = JSON->new ->pretty ->canonical ->encode({ $url ? (url=>$url) : (), $private_token ? (private_token=>$private_token) : (), $access_token ? (access_token=>$access_token) : (), }); my $file = path( $self->file() ); $file->touch(); $file->chmod( 0600 ); $file->spew( $json ); $log->infof( 'Configuration for GitLab::API::v4 saved to: %s', $file->absolute() ); return; } 1; __END__ =head1 AUTHORS See L and L. =head1 LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Constants.pm100644000765000024 353213235441140 20207 0ustar00aranstaff000000000000GitLab-API-v4-0.04/lib/GitLab/API/v4package GitLab::API::v4::Constants; $GitLab::API::v4::Constants::VERSION = '0.04'; =head1 NAME GitLab::API::v4::Constants - GitLab API v4 constants. =head1 SYNOPSIS use GitLab::API::v4::Constants qw( :all ); print $GITLAB_INTERNAL_VISIBILITY_LEVEL; # 10 =cut use Const::Fast; use strictures 2; use namespace::clean; use Exporter qw( import ); our @EXPORT_OK; our %EXPORT_TAGS = ( all => \@EXPORT_OK ); =head1 CONSTANTS =head2 $GITLAB_ACCESS_LEVEL_GUEST C<10> =cut const our $GITLAB_ACCESS_LEVEL_GUEST => 10; push @EXPORT_OK, '$GITLAB_ACCESS_LEVEL_GUEST'; =head2 $GITLAB_ACCESS_LEVEL_REPORTER C<20> =cut const our $GITLAB_ACCESS_LEVEL_REPORTER => 20; push @EXPORT_OK, '$GITLAB_ACCESS_LEVEL_REPORTER'; =head2 $GITLAB_ACCESS_LEVEL_DEVELOPER C<30> =cut const our $GITLAB_ACCESS_LEVEL_DEVELOPER => 30; push @EXPORT_OK, '$GITLAB_ACCESS_LEVEL_DEVELOPER'; =head2 $GITLAB_ACCESS_LEVEL_MASTER C<40> =cut const our $GITLAB_ACCESS_LEVEL_MASTER => 40; push @EXPORT_OK, '$GITLAB_ACCESS_LEVEL_MASTER'; =head2 $GITLAB_ACCESS_LEVEL_OWNER C<50> =cut const our $GITLAB_ACCESS_LEVEL_OWNER => 50; push @EXPORT_OK, '$GITLAB_ACCESS_LEVEL_OWNER'; =head2 @GITLAB_ACCESS_LEVELS An array containing the values for L, L, L, L, and L. =cut const our @GITLAB_ACCESS_LEVELS => ( $GITLAB_ACCESS_LEVEL_GUEST, $GITLAB_ACCESS_LEVEL_REPORTER, $GITLAB_ACCESS_LEVEL_DEVELOPER, $GITLAB_ACCESS_LEVEL_MASTER, $GITLAB_ACCESS_LEVEL_OWNER, ); push @EXPORT_OK, '@GITLAB_ACCESS_LEVELS'; 1; __END__ =head1 AUTHORS See L and L. =head1 LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Paginator.pm100644000765000024 764113235441140 20164 0ustar00aranstaff000000000000GitLab-API-v4-0.04/lib/GitLab/API/v4package GitLab::API::v4::Paginator; $GitLab::API::v4::Paginator::VERSION = '0.04'; =head1 NAME GitLab::API::v4::Paginator - Iterate through paginated GitLab v4 API records. =head1 DESCRIPTION There should be no need to create objects of this type directly, instead use L which simplifies things a bit. =cut use Types::Standard -types; use Types::Common::String -types; use Carp qw( croak ); use Moo; use strictures 2; use namespace::clean; =head1 REQUIRED ARGUMENTS =head2 method The name of the method subroutine to call on the L object to get records from. This method must accept a hash ref of parameters as the last argument, adhere to the C and C parameters, and return an array ref. =cut has method => ( is => 'ro', isa => NonEmptySimpleStr, required => 1, ); =head2 api The L object. =cut has api => ( is => 'ro', isa => InstanceOf[ 'GitLab::API::v4' ], required => 1, ); =head1 OPTIONAL ARGUMENTS =head2 args The arguments to use when calling the L, the same arguments you would use when you call the method yourself on the L object, minus the C<\%params> hash ref. =cut has args => ( is => 'ro', isa => ArrayRef, default => sub{ [] }, ); =head2 params The C<\%params> hash ref argument. =cut has params => ( is => 'ro', isa => HashRef, default => sub{ {} }, ); =head1 METHODS =cut has _records => ( is => 'rw', init_arg => undef, default => sub{ [] }, ); has _page => ( is => 'rw', init_arg => undef, default => 0, ); has _last_page => ( is => 'rw', init_arg => undef, default => 0, ); =head2 next_page while (my $records = $paginator->next_page()) { ... } Returns an array ref of records for the next page. =cut sub next_page { my ($self) = @_; return if $self->_last_page(); my $page = $self->_page() + 1; my $params = $self->params(); my $per_page = $params->{per_page} || 20; $params = { %$params, page => $page, per_page => $per_page, }; my $method = $self->method(); my $records = $self->api->$method( @{ $self->args() }, $params, ); croak("The $method method returned a non array ref value") if ref($records) ne 'ARRAY'; $self->_page( $page ); $self->_last_page( 1 ) if @$records < $per_page; $self->_records( [ @$records ] ); return if !@$records; return $records; } =head2 next while (my $record = $paginator->next()) { ... } Returns the next record in the current page. If all records have been exhausted then L will automatically be called. This way if you want to ignore pagination you can just call C over and over again to walk through all the records. =cut sub next { my ($self) = @_; my $records = $self->_records(); return shift(@$records) if @$records; return if $self->_last_page(); $self->next_page(); $records = $self->_records(); return shift(@$records) if @$records; return; } =head2 all my $records = $paginator->all(); This is just an alias for calling L over and over again to build an array ref of all records. =cut sub all { my ($self) = @_; $self->reset(); my @records; while (my $page = $self->next_page()) { push @records, @$page; } return \@records; } =head2 reset $paginator->reset(); Reset the paginator back to its original state on the first page with no records retrieved yet. =cut sub reset { my ($self) = @_; $self->_records( [] ); $self->_page( 0 ); $self->_last_page( 0 ); return; } 1; __END__ =head1 AUTHORS See L and L. =head1 LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. RESTClient.pm100644000765000024 475013235441140 20152 0ustar00aranstaff000000000000GitLab-API-v4-0.04/lib/GitLab/API/v4package GitLab::API::v4::RESTClient; $GitLab::API::v4::RESTClient::VERSION = '0.04'; =head1 NAME GitLab::API::v4::RESTClient - GitLab API v4 REST client. =head2 DESCRIPTION This module provides the actual REST communication with the GitLab server and is powered by L. The various HTTP verb methods are wrapped so that they throw an exception if an unexpected response is received, except for GET requests that respond with a 404 code; these return C instead. If the request was successful then the response data is returned rather than the response object itself. =cut use Carp qw( confess ); use Data::Dumper qw(); use Role::REST::Client::Response; use Try::Tiny; use Log::Any qw( $log ); use Types::Common::Numeric -types; use Moo; use strictures 2; use namespace::clean; with 'Role::REST::Client'; has retries => ( is => 'ro', isa => PositiveOrZeroInt, default => 0, ); foreach my $method (qw( post get head put delete options )) { around $method => sub{ my $orig = shift; my $self = shift; my $path = shift; my $res; my $retry = $self->retries; do { $log->tracef( 'Making %s request against %s', uc($method), $path ); $res = $self->$orig( "/$path", @_ ); if ($res->code =~ /^5/) { $log->warn('Request failed. Retrying...') if $retry; } else { $retry = 0; } } while --$retry >= 0; return undef if $res->code() eq '404' and $method eq 'get'; if ($res->failed()) { local $Carp::Internal{ 'GitLab::API::v4::RESTClient' } = 1; local $Carp::Internal{ 'GitLab::API::v4' } = 1; confess sprintf( 'Error %sing %s from %s (HTTP %s): %s %s', uc($method), $path, $self->server(), $res->code(), $res->error(), _dump_one_line( $res->data() ), ); } return $res->data(); }; } # Stolen and modified from Log::Any::Adapter::Core. sub _dump_one_line { my ($value) = @_; return '' if !defined $value; return Data::Dumper->new( [$value] )->Indent(0)->Sortkeys(1)->Quotekeys(0) ->Terse(1)->Dump() if ref($value); $value =~ s{\s+}{ }g; return $value; } 1; __END__ =head1 AUTHORS See L and L. =head1 LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.